Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: introduce breakpoint editor #46540

Merged
merged 4 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions src/vs/workbench/parts/debug/browser/debugEditorActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import { TPromise } from 'vs/base/common/winjs.base';
import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
import { Range } from 'vs/editor/common/core/range';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ServicesAccessor, registerEditorAction, EditorAction, EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions';
import { ServicesAccessor, registerEditorAction, EditorAction } from 'vs/editor/browser/editorExtensions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IDebugService, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, CONTEXT_DEBUG_STATE, State, REPL_ID, VIEWLET_ID, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, BreakpointWidgetContext } from 'vs/workbench/parts/debug/common/debug';
import { IDebugService, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, CONTEXT_DEBUG_STATE, State, REPL_ID, VIEWLET_ID, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, BreakpointWidgetContext } from 'vs/workbench/parts/debug/common/debug';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';

class ToggleBreakpointAction extends EditorAction {
Expand Down Expand Up @@ -210,31 +209,10 @@ class ShowDebugHoverAction extends EditorAction {
}
}

class CloseBreakpointWidgetCommand extends EditorCommand {

constructor() {
super({
id: 'closeBreakpointWidget',
precondition: CONTEXT_BREAKPOINT_WIDGET_VISIBLE,
kbOpts: {
weight: KeybindingsRegistry.WEIGHT.editorContrib(8),
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
});
}

public runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {
return editor.getContribution<IDebugEditorContribution>(EDITOR_CONTRIBUTION_ID).closeBreakpointWidget();
}
}

registerEditorAction(ToggleBreakpointAction);
registerEditorAction(ConditionalBreakpointAction);
registerEditorAction(LogPointAction);
registerEditorAction(RunToCursorAction);
registerEditorAction(SelectionToReplAction);
registerEditorAction(SelectionToWatchExpressionsAction);
registerEditorAction(ShowDebugHoverAction);
registerEditorCommand(new CloseBreakpointWidgetCommand());
25 changes: 4 additions & 21 deletions src/vs/workbench/parts/debug/browser/media/breakpointWidget.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,11 @@
justify-content: center;
flex-direction: column;
padding: 0 10px;
flex-shrink: 0;
}

.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .inputBoxContainer {
.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .inputContainer {
flex: 1;
}

.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .monaco-inputbox {
border: none;
}

.monaco-editor .breakpoint-widget .input {
font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";
line-height: 22px;
background-color: transparent;
padding: 8px;
}

.monaco-workbench.mac .monaco-editor .breakpoint-widget .input {
font-size: 11px;
}

.monaco-workbench.windows .monaco-editor .breakpoint-widget .input,
.monaco-workbench.linux .monaco-editor .breakpoint-widget .input {
font-size: 13px;
margin-top: 6px;
margin-bottom: 6px;
}
Loading