Skip to content

Commit

Permalink
debug: introduce breakpoints extension point
Browse files Browse the repository at this point in the history
fixes #9037
  • Loading branch information
isidorn committed Jul 20, 2016
1 parent 2bc3457 commit 082cfee
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/vs/workbench/parts/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
27 changes: 26 additions & 1 deletion src/vs/workbench/parts/debug/node/debugConfigurationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<debug.IRawAdapter[]>('debuggers', {
description: nls.localize('vscode.extension.contributes.debuggers', 'Contributes debug adapters.'),
type: 'array',
Expand Down Expand Up @@ -124,6 +124,23 @@ export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerE
}
});

// breakpoints extension point #9037
export const breakpointsExtPoint = extensionsRegistry.ExtensionsRegistry.registerExtensionPoint<debug.IRawBreakpointContribution[]>('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';
Expand Down Expand Up @@ -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<string> {
Expand Down

0 comments on commit 082cfee

Please sign in to comment.