Skip to content

Commit

Permalink
debug: add to watch should open the watch view, not debug viewlet
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Aug 13, 2020
1 parent 4782dbf commit f4b3ea0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/vs/workbench/contrib/debug/browser/debugEditorActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { Range } from 'vs/editor/common/core/range';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ServicesAccessor, registerEditorAction, EditorAction, IActionOptions } from 'vs/editor/browser/editorExtensions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IDebugService, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE, State, VIEWLET_ID, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, BreakpointWidgetContext, IBreakpoint, BREAKPOINT_EDITOR_CONTRIBUTION_ID, IBreakpointEditorContribution, REPL_VIEW_ID, CONTEXT_STEP_INTO_TARGETS_SUPPORTED } from 'vs/workbench/contrib/debug/common/debug';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IDebugService, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE, State, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, BreakpointWidgetContext, IBreakpoint, BREAKPOINT_EDITOR_CONTRIBUTION_ID, IBreakpointEditorContribution, REPL_VIEW_ID, CONTEXT_STEP_INTO_TARGETS_SUPPORTED, WATCH_VIEW_ID } from 'vs/workbench/contrib/debug/common/debug';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { openBreakpointSource } from 'vs/workbench/contrib/debug/browser/breakpointsView';
Expand Down Expand Up @@ -210,13 +209,13 @@ class SelectionToWatchExpressionsAction extends EditorAction {

async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {
const debugService = accessor.get(IDebugService);
const viewletService = accessor.get(IViewletService);
const viewsService = accessor.get(IViewsService);
if (!editor.hasModel()) {
return;
}

const text = editor.getModel().getValueInRange(editor.getSelection());
await viewletService.openViewlet(VIEWLET_ID);
await viewsService.openView(WATCH_VIEW_ID);
debugService.addWatchExpression(text);
}
}
Expand Down

0 comments on commit f4b3ea0

Please sign in to comment.