Skip to content

Commit

Permalink
feat: preference service override
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Apr 7, 2023
1 parent dcc29ae commit 3063e8e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Additionally, this library exposes 12 modules that include the vscode version of
- Audio cue: `vscode/service-override/audioCue`
- Debug: `vscode/service-override/debug`
- Files: `vscode/service-override/files`
- preferences: `vscode/service-override/preferences`

Usage:

Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
"types": "./dist/debug.d.ts",
"default": "./dist/debug.js"
},
"./service-override/preferences": {
"types": "./dist/preferences.d.ts",
"default": "./dist/preferences.js"
},
"./monaco": {
"types": "./dist/monaco.d.ts",
"default": "./dist/monaco.js"
Expand Down Expand Up @@ -143,6 +147,9 @@
"service-override/debug": [
"./dist/debug.d.ts"
],
"service-override/preferences": [
"./dist/preferences.d.ts"
],
"monaco": [
"./dist/monaco.d.ts"
],
Expand Down
1 change: 1 addition & 0 deletions rollup/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ const input = {
languages: './src/service-override/languages.ts',
audioCue: './src/service-override/audioCue.ts',
debug: './src/service-override/debug.ts',
preferences: './src/service-override/preferences.ts',
monaco: './src/monaco'
}

Expand Down
1 change: 1 addition & 0 deletions rollup/rollup.types.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default rollup.defineConfig([
'./dist/types/src/service-override/languages.d.ts',
'./dist/types/src/service-override/audioCue.d.ts',
'./dist/types/src/service-override/debug.d.ts',
'./dist/types/src/service-override/preferences.d.ts',
'./dist/types/src/monaco.d.ts'
].map((input): rollup.RollupOptions => ({
input,
Expand Down
12 changes: 12 additions & 0 deletions src/service-override/preferences.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import '../polyfill'
import '../vscode-services/missing-services'
import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices'
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'
import { PreferencesService } from 'vs/workbench/services/preferences/browser/preferencesService'

export default function getServiceOverride (): IEditorOverrideServices {
return {
[IPreferencesService.toString()]: new SyncDescriptor(PreferencesService)
}
}
1 change: 1 addition & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"src/service-override/languages.ts",
"src/service-override/audioCue.ts",
"src/service-override/debug.ts",
"src/service-override/preferences.ts",
"src/monaco.ts"
]
}

0 comments on commit 3063e8e

Please sign in to comment.