未验证 提交 9a70d1c4 编写于 作者: I Isidor Nikolic 提交者: GitHub

Merge pull request #46629 from marcobeltempo/issue46509

Fixes #46509 - Added key binding to disable a single breakpoint
......@@ -44,6 +44,29 @@ export function registerCommands(): void {
}
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'debug.enableOrDisableBreakpoint',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
primary: undefined,
when: EditorContextKeys.editorTextFocus,
handler: (accessor) => {
const debugService = accessor.get(IDebugService);
const editorService = accessor.get(IWorkbenchEditorService);
const editor = editorService.getActiveEditor();
const control = <ICodeEditor>editor.getControl();
if (control) {
const position = control.getPosition();
const modelUri = control.getModel().uri;
const bp = debugService.getModel().getBreakpoints()
.filter(bp => bp.lineNumber === position.lineNumber, bp => bp.column === position.column && bp.uri.toString() === modelUri.toString()).pop();
if (bp) {
debugService.enableOrDisableBreakpoints(!bp.enabled, bp).done(null, errors.onUnexpectedError);
}
}
}
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'debug.renameWatchExpression',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(5),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册