From 082cfeee65c6eb830dfcfd8215e4aab0b94781e3 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 20 Jul 2016 11:48:14 +0200 Subject: [PATCH] debug: introduce breakpoints extension point fixes #9037 --- src/vs/workbench/parts/debug/common/debug.ts | 4 +++ .../debug/node/debugConfigurationManager.ts | 27 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 6231a8bf2e972..8828bcc4fb025 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -237,6 +237,10 @@ export interface IRawAdapter extends IRawEnvAdapter { linux?: IRawEnvAdapter; } +export interface IRawBreakpointContribution { + language: string; +} + export interface IRawDebugSession { configuration: { type: string, isAttach: boolean, capabilities: DebugProtocol.Capabilites }; diff --git a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts index 922754d4f7887..4db6dae094ab6 100644 --- a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts @@ -31,8 +31,8 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import { IQuickOpenService } from 'vs/workbench/services/quickopen/common/quickOpenService'; import { ConfigVariables } from 'vs/workbench/parts/lib/node/configVariables'; import { ISystemVariables } from 'vs/base/common/parsers'; -// debuggers extension point +// debuggers extension point export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerExtensionPoint('debuggers', { description: nls.localize('vscode.extension.contributes.debuggers', 'Contributes debug adapters.'), type: 'array', @@ -124,6 +124,23 @@ export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerE } }); +// breakpoints extension point #9037 +export const breakpointsExtPoint = extensionsRegistry.ExtensionsRegistry.registerExtensionPoint('breakpoints', { + description: nls.localize('vscode.extension.contributes.breakpoints', 'Contributes breakpoints.'), + type: 'array', + defaultSnippets: [{ body: [{ language: '' }] }], + items: { + type: 'object', + defaultSnippets: [{ body: { language: '' } }], + properties: { + language: { + description: nls.localize('vscode.extension.contributes.breakpoints.language', "Allow breakpoints for this language."), + type: 'string' + }, + } + } +}); + // debug general schema export const schemaId = 'vscode://schemas/launch'; @@ -222,6 +239,14 @@ export class ConfigurationManager implements debug.IConfigurationManager { } }); }); + + breakpointsExtPoint.setHandler(extensions => { + extensions.forEach(ext => { + ext.value.forEach(breakpoints => { + this.allModeIdsForBreakpoints[breakpoints.language] = true; + }); + }); + }); } public get onDidConfigurationChange(): Event {