diff --git a/README.md b/README.md index 9fe29164..d1a32817 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ StandaloneServices.initialize({ }) ``` -Additionally, this library exposes 11 modules that include the vscode version of some services (with some glue to make it work with monaco): +Additionally, this library exposes 12 modules that include the vscode version of some services (with some glue to make it work with monaco): - Notifications: `vscode/service-override/notifications` - Dialogs: `vscode/service-override/dialogs` @@ -63,6 +63,7 @@ Additionally, this library exposes 11 modules that include the vscode version of - VSCode themes: `vscode/service-override/theme` - Token classification: `vscode/service-override/tokenClassification` - Audio cue: `vscode/service-override/audioCue` +- Debug: `vscode/service-override/debug` Usage: diff --git a/package.json b/package.json index 8e701347..20e161ad 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,10 @@ "types": "./dist/audioCue.d.ts", "default": "./dist/audioCue.js" }, + "./service-override/debug": { + "types": "./dist/debug.d.ts", + "default": "./dist/debug.js" + }, "./monaco": { "types": "./dist/monaco.d.ts", "default": "./dist/monaco.js" @@ -129,6 +133,9 @@ "service-override/audioCue": [ "./dist/audioCue.d.ts" ], + "service-override/debug": [ + "./dist/debug.d.ts" + ], "monaco": [ "./dist/monaco.d.ts" ], diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 54e92e9e..43493642 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -134,6 +134,7 @@ const input = { snippets: './src/service-override/snippets.ts', languages: './src/service-override/languages.ts', audioCue: './src/service-override/audioCue.ts', + debug: './src/service-override/debug.ts', monaco: './src/monaco' } diff --git a/rollup/rollup.types.config.ts b/rollup/rollup.types.config.ts index 07366b2d..f16bb0ad 100644 --- a/rollup/rollup.types.config.ts +++ b/rollup/rollup.types.config.ts @@ -34,6 +34,7 @@ export default rollup.defineConfig([ './dist/types/src/service-override/snippets.d.ts', './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/monaco.d.ts' ].map((input): rollup.RollupOptions => ({ input, diff --git a/src/service-override/debug.ts b/src/service-override/debug.ts new file mode 100644 index 00000000..56e50bf7 --- /dev/null +++ b/src/service-override/debug.ts @@ -0,0 +1,39 @@ +import '../polyfill' +import '../vscode-services/missing-services' +import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { IRawLanguageExtensionPoint } from 'vs/workbench/services/language/common/languageService' +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' +import { IDebugService } from 'vs/workbench/contrib/debug/common/debug' +import { DebugService } from 'vs/workbench/contrib/debug/browser/debugService' +import { LanguageFeaturesService } from 'vscode/vs/editor/common/services/languageFeaturesService' +import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures' +import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService' +import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver' +import { DebugToolBar } from 'vs/workbench/contrib/debug/browser/debugToolBar' +import { DebugContentProvider } from 'vs/workbench/contrib/debug/common/debugContentProvider' +import getLayoutServiceOverride from './layout' +import { onServicesInitialized } from './tools' +import 'vs/workbench/contrib/debug/browser/debug.contribution' + +function initialize (instantiationService: IInstantiationService) { + setTimeout(() => { + instantiationService.createInstance(DebugToolBar) + instantiationService.createInstance(DebugContentProvider) + }) +} + +export default function getServiceOverride (): IEditorOverrideServices { + onServicesInitialized(initialize) + + return { + ...getLayoutServiceOverride(), + [ILanguageFeaturesService.toString()]: new SyncDescriptor(LanguageFeaturesService), // To restore inlineValuesProvider + [IDebugService.toString()]: new SyncDescriptor(DebugService), + [IConfigurationResolverService.toString()]: new SyncDescriptor(ConfigurationResolverService) + } +} + +export { + IRawLanguageExtensionPoint +} diff --git a/src/services.ts b/src/services.ts index 2ea4894e..502d49c3 100644 --- a/src/services.ts +++ b/src/services.ts @@ -96,6 +96,7 @@ export { ISnippetsService } from 'vs/workbench/contrib/snippets/browser/snippets export { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' export { IStorageService } from 'vs/platform/storage/common/storage' export { IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService' +export { IDebugService } from 'vs/workbench/contrib/debug/common/debug' export { NotificationsFilter, diff --git a/tsconfig.types.json b/tsconfig.types.json index 7583c703..6f1a3f6b 100644 --- a/tsconfig.types.json +++ b/tsconfig.types.json @@ -68,6 +68,7 @@ "src/service-override/snippets.ts", "src/service-override/languages.ts", "src/service-override/audioCue.ts", + "src/service-override/debug.ts", "src/monaco.ts" ] } \ No newline at end of file