@codingame/monaco-vscode-debug-service-override 1.82.4 → 1.82.5-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/debug.d.ts +5 -0
- package/debug.js +24 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +2 -2
- package/vscode/src/vs/editor/common/services/languageFeaturesService.js +44 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +200 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +785 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +399 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1298 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +960 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +497 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +347 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +299 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +400 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +827 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +621 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +60 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +527 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +681 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +356 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +206 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +82 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +143 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +1174 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +1144 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +106 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +68 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +275 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +314 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +168 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +663 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +105 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +231 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +631 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +695 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +953 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +48 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +336 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +98 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +575 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +415 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +102 -0
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +21 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +17 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +100 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +59 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1482 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +346 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +123 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +175 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +36 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +117 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +260 -0
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +27 -0
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +83 -0
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +283 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +305 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +28 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +176 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +12 -0
|
@@ -0,0 +1,1298 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { Gesture } from 'monaco-editor/esm/vs/base/browser/touch.js';
|
|
4
|
+
import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
|
|
5
|
+
import { IconLabel } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js';
|
|
6
|
+
import { InputBox } from 'monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js';
|
|
7
|
+
import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
8
|
+
import { equals } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
9
|
+
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
10
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
11
|
+
import { MarkdownString } from 'monaco-editor/esm/vs/base/common/htmlContent.js';
|
|
12
|
+
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
13
|
+
import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
14
|
+
import { isCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
15
|
+
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
16
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
17
|
+
import { createAndFillInActionBarActions, createAndFillInContextMenuActions } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
|
|
18
|
+
import { registerAction2, Action2, MenuId, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
19
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
20
|
+
import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
21
|
+
import { IContextMenuService, IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
22
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
23
|
+
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
24
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
25
|
+
import { WorkbenchList } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
26
|
+
import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
27
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
28
|
+
import { defaultInputBoxStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
29
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
30
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
31
|
+
import { ViewAction, ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
32
|
+
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
33
|
+
import { dataBreakpoint, functionBreakpoint, logBreakpoint, breakpoint, debugBreakpointUnsupported, conditionalBreakpoint, watchExpressionsAddFuncBreakpoint, breakpointsActivate, breakpointsRemoveAll } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
|
|
34
|
+
import { BREAKPOINTS_VIEW_ID, CONTEXT_DEBUGGERS_AVAILABLE, IDebugService, CONTEXT_BREAKPOINT_ITEM_TYPE, CONTEXT_BREAKPOINTS_EXIST, CONTEXT_IN_DEBUG_MODE, CONTEXT_BREAKPOINT_SUPPORTS_CONDITION, BREAKPOINT_EDITOR_CONTRIBUTION_ID, CONTEXT_BREAKPOINT_INPUT_FOCUSED, CONTEXT_BREAKPOINTS_FOCUSED, DebuggerString, DEBUG_SCHEME } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
35
|
+
import { DataBreakpoint, FunctionBreakpoint, InstructionBreakpoint, Breakpoint, ExceptionBreakpoint } from '../common/debugModel.js';
|
|
36
|
+
import { DisassemblyViewInput } from '../common/disassemblyViewInput.js';
|
|
37
|
+
import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
38
|
+
import { IHoverService } from 'vscode/vscode/vs/workbench/services/hover/browser/hover';
|
|
39
|
+
|
|
40
|
+
var BreakpointsRenderer_1, FunctionBreakpointsRenderer_1, DataBreakpointsRenderer_1, InstructionBreakpointsRenderer_1;
|
|
41
|
+
const $ = dom.$;
|
|
42
|
+
function createCheckbox(disposables) {
|
|
43
|
+
const checkbox = $('input');
|
|
44
|
+
checkbox.type = 'checkbox';
|
|
45
|
+
checkbox.tabIndex = -1;
|
|
46
|
+
disposables.push(Gesture.ignoreTarget(checkbox));
|
|
47
|
+
return checkbox;
|
|
48
|
+
}
|
|
49
|
+
const MAX_VISIBLE_BREAKPOINTS = 9;
|
|
50
|
+
function getExpandedBodySize(model, sessionId, countLimit) {
|
|
51
|
+
const length = model.getBreakpoints().length + model.getExceptionBreakpointsForSession(sessionId).length + model.getFunctionBreakpoints().length + model.getDataBreakpoints().length + model.getInstructionBreakpoints().length;
|
|
52
|
+
return Math.min(countLimit, length) * 22;
|
|
53
|
+
}
|
|
54
|
+
let BreakpointsView = class BreakpointsView extends ViewPane {
|
|
55
|
+
constructor(options, contextMenuService, debugService, keybindingService, instantiationService, themeService, editorService, contextViewService, configurationService, viewDescriptorService, contextKeyService, openerService, telemetryService, labelService, menuService, hoverService, languageService) {
|
|
56
|
+
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
57
|
+
this.debugService = debugService;
|
|
58
|
+
this.editorService = editorService;
|
|
59
|
+
this.contextViewService = contextViewService;
|
|
60
|
+
this.labelService = labelService;
|
|
61
|
+
this.hoverService = hoverService;
|
|
62
|
+
this.languageService = languageService;
|
|
63
|
+
this.needsRefresh = false;
|
|
64
|
+
this.needsStateChange = false;
|
|
65
|
+
this.ignoreLayout = false;
|
|
66
|
+
this.autoFocusedIndex = -1;
|
|
67
|
+
this.menu = menuService.createMenu(MenuId.DebugBreakpointsContext, contextKeyService);
|
|
68
|
+
this._register(this.menu);
|
|
69
|
+
this.breakpointItemType = CONTEXT_BREAKPOINT_ITEM_TYPE.bindTo(contextKeyService);
|
|
70
|
+
this.breakpointSupportsCondition = CONTEXT_BREAKPOINT_SUPPORTS_CONDITION.bindTo(contextKeyService);
|
|
71
|
+
this.breakpointInputFocused = CONTEXT_BREAKPOINT_INPUT_FOCUSED.bindTo(contextKeyService);
|
|
72
|
+
this._register(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange()));
|
|
73
|
+
this._register(this.debugService.getViewModel().onDidFocusSession(() => this.onBreakpointsChange()));
|
|
74
|
+
this._register(this.debugService.onDidChangeState(() => this.onStateChange()));
|
|
75
|
+
this.hintDelayer = this._register(( new RunOnceScheduler(() => this.updateBreakpointsHint(true), 4000)));
|
|
76
|
+
}
|
|
77
|
+
renderBody(container) {
|
|
78
|
+
super.renderBody(container);
|
|
79
|
+
this.element.classList.add('debug-pane');
|
|
80
|
+
container.classList.add('debug-breakpoints');
|
|
81
|
+
const delegate = ( new BreakpointsDelegate(this));
|
|
82
|
+
this.list = this.instantiationService.createInstance(WorkbenchList, 'Breakpoints', container, delegate, [
|
|
83
|
+
this.instantiationService.createInstance(BreakpointsRenderer, this.menu, this.breakpointSupportsCondition, this.breakpointItemType),
|
|
84
|
+
( new ExceptionBreakpointsRenderer(
|
|
85
|
+
this.menu,
|
|
86
|
+
this.breakpointSupportsCondition,
|
|
87
|
+
this.breakpointItemType,
|
|
88
|
+
this.debugService
|
|
89
|
+
)),
|
|
90
|
+
( new ExceptionBreakpointInputRenderer(this, this.debugService, this.contextViewService)),
|
|
91
|
+
this.instantiationService.createInstance(FunctionBreakpointsRenderer, this.menu, this.breakpointSupportsCondition, this.breakpointItemType),
|
|
92
|
+
this.instantiationService.createInstance(DataBreakpointsRenderer),
|
|
93
|
+
( new FunctionBreakpointInputRenderer(this, this.debugService, this.contextViewService, this.labelService)),
|
|
94
|
+
this.instantiationService.createInstance(InstructionBreakpointsRenderer),
|
|
95
|
+
], {
|
|
96
|
+
identityProvider: { getId: (element) => element.getId() },
|
|
97
|
+
multipleSelectionSupport: false,
|
|
98
|
+
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e) => e },
|
|
99
|
+
accessibilityProvider: ( new BreakpointsAccessibilityProvider(this.debugService, this.labelService)),
|
|
100
|
+
overrideStyles: {
|
|
101
|
+
listBackground: this.getBackgroundColor()
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
CONTEXT_BREAKPOINTS_FOCUSED.bindTo(this.list.contextKeyService);
|
|
105
|
+
this._register(this.list.onContextMenu(this.onListContextMenu, this));
|
|
106
|
+
this.list.onMouseMiddleClick(async ({ element }) => {
|
|
107
|
+
if (element instanceof Breakpoint) {
|
|
108
|
+
await this.debugService.removeBreakpoints(element.getId());
|
|
109
|
+
}
|
|
110
|
+
else if (element instanceof FunctionBreakpoint) {
|
|
111
|
+
await this.debugService.removeFunctionBreakpoints(element.getId());
|
|
112
|
+
}
|
|
113
|
+
else if (element instanceof DataBreakpoint) {
|
|
114
|
+
await this.debugService.removeDataBreakpoints(element.getId());
|
|
115
|
+
}
|
|
116
|
+
else if (element instanceof InstructionBreakpoint) {
|
|
117
|
+
await this.debugService.removeInstructionBreakpoints(element.instructionReference);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
this._register(this.list.onDidOpen(async (e) => {
|
|
121
|
+
if (!e.element) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (e.browserEvent instanceof MouseEvent && e.browserEvent.button === 1) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (e.element instanceof Breakpoint) {
|
|
128
|
+
openBreakpointSource(e.element, e.sideBySide, e.editorOptions.preserveFocus || false, e.editorOptions.pinned || !e.editorOptions.preserveFocus, this.debugService, this.editorService);
|
|
129
|
+
}
|
|
130
|
+
if (e.element instanceof InstructionBreakpoint) {
|
|
131
|
+
const disassemblyView = await this.editorService.openEditor(DisassemblyViewInput.instance);
|
|
132
|
+
disassemblyView.goToAddress(e.element.instructionReference, e.browserEvent instanceof MouseEvent && e.browserEvent.detail === 2);
|
|
133
|
+
}
|
|
134
|
+
if (e.browserEvent instanceof MouseEvent && e.browserEvent.detail === 2 && e.element instanceof FunctionBreakpoint && e.element !== this.inputBoxData?.breakpoint) {
|
|
135
|
+
this.renderInputBox({ breakpoint: e.element, type: 'name' });
|
|
136
|
+
}
|
|
137
|
+
}));
|
|
138
|
+
this.list.splice(0, this.list.length, this.elements);
|
|
139
|
+
this._register(this.onDidChangeBodyVisibility(visible => {
|
|
140
|
+
if (visible) {
|
|
141
|
+
if (this.needsRefresh) {
|
|
142
|
+
this.onBreakpointsChange();
|
|
143
|
+
}
|
|
144
|
+
if (this.needsStateChange) {
|
|
145
|
+
this.onStateChange();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}));
|
|
149
|
+
const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id));
|
|
150
|
+
this._register(containerModel.onDidChangeAllViewDescriptors(() => {
|
|
151
|
+
this.updateSize();
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
renderHeaderTitle(container, title) {
|
|
155
|
+
super.renderHeaderTitle(container, title);
|
|
156
|
+
const iconLabelContainer = dom.append(container, $('span.breakpoint-warning'));
|
|
157
|
+
this.hintContainer = this._register(( new IconLabel(iconLabelContainer, {
|
|
158
|
+
supportIcons: true, hoverDelegate: {
|
|
159
|
+
showHover: (options, focus) => this.hoverService.showHover({ content: options.content, target: this.hintContainer.element }, focus),
|
|
160
|
+
delay: this.configurationService.getValue('workbench.hover.delay')
|
|
161
|
+
}
|
|
162
|
+
})));
|
|
163
|
+
dom.hide(this.hintContainer.element);
|
|
164
|
+
}
|
|
165
|
+
focus() {
|
|
166
|
+
super.focus();
|
|
167
|
+
this.list?.domFocus();
|
|
168
|
+
}
|
|
169
|
+
renderInputBox(data) {
|
|
170
|
+
this._inputBoxData = data;
|
|
171
|
+
this.onBreakpointsChange();
|
|
172
|
+
this._inputBoxData = undefined;
|
|
173
|
+
}
|
|
174
|
+
get inputBoxData() {
|
|
175
|
+
return this._inputBoxData;
|
|
176
|
+
}
|
|
177
|
+
layoutBody(height, width) {
|
|
178
|
+
if (this.ignoreLayout) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
super.layoutBody(height, width);
|
|
182
|
+
this.list?.layout(height, width);
|
|
183
|
+
try {
|
|
184
|
+
this.ignoreLayout = true;
|
|
185
|
+
this.updateSize();
|
|
186
|
+
}
|
|
187
|
+
finally {
|
|
188
|
+
this.ignoreLayout = false;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
onListContextMenu(e) {
|
|
192
|
+
const element = e.element;
|
|
193
|
+
const type = element instanceof Breakpoint ? 'breakpoint' : element instanceof ExceptionBreakpoint ? 'exceptionBreakpoint' :
|
|
194
|
+
element instanceof FunctionBreakpoint ? 'functionBreakpoint' : element instanceof DataBreakpoint ? 'dataBreakpoint' :
|
|
195
|
+
element instanceof InstructionBreakpoint ? 'instructionBreakpoint' : undefined;
|
|
196
|
+
this.breakpointItemType.set(type);
|
|
197
|
+
const session = this.debugService.getViewModel().focusedSession;
|
|
198
|
+
const conditionSupported = element instanceof ExceptionBreakpoint ? element.supportsCondition : (!session || !!session.capabilities.supportsConditionalBreakpoints);
|
|
199
|
+
this.breakpointSupportsCondition.set(conditionSupported);
|
|
200
|
+
const secondary = [];
|
|
201
|
+
createAndFillInContextMenuActions(this.menu, { arg: e.element, shouldForwardArgs: false }, { primary: [], secondary }, 'inline');
|
|
202
|
+
this.contextMenuService.showContextMenu({
|
|
203
|
+
getAnchor: () => e.anchor,
|
|
204
|
+
getActions: () => secondary,
|
|
205
|
+
getActionsContext: () => element
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
updateSize() {
|
|
209
|
+
const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id));
|
|
210
|
+
const sessionId = this.debugService.getViewModel().focusedSession?.getId();
|
|
211
|
+
this.minimumBodySize = this.orientation === 0 ? getExpandedBodySize(this.debugService.getModel(), sessionId, MAX_VISIBLE_BREAKPOINTS) : 170;
|
|
212
|
+
this.maximumBodySize = this.orientation === 0 && containerModel.visibleViewDescriptors.length > 1 ? getExpandedBodySize(this.debugService.getModel(), sessionId, Number.POSITIVE_INFINITY) : Number.POSITIVE_INFINITY;
|
|
213
|
+
}
|
|
214
|
+
updateBreakpointsHint(delayed = false) {
|
|
215
|
+
if (!this.hintContainer) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const currentType = this.debugService.getViewModel().focusedSession?.configuration.type;
|
|
219
|
+
const dbg = currentType ? this.debugService.getAdapterManager().getDebugger(currentType) : undefined;
|
|
220
|
+
const message = dbg?.strings?.[DebuggerString.UnverifiedBreakpoints];
|
|
221
|
+
const debuggerHasUnverifiedBps = message && this.debugService.getModel().getBreakpoints().filter(bp => {
|
|
222
|
+
if (bp.verified || !bp.enabled) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
const langId = this.languageService.guessLanguageIdByFilepathOrFirstLine(bp.uri);
|
|
226
|
+
return langId && dbg.interestedInLanguage(langId);
|
|
227
|
+
});
|
|
228
|
+
if (message && debuggerHasUnverifiedBps?.length && this.debugService.getModel().areBreakpointsActivated()) {
|
|
229
|
+
if (delayed) {
|
|
230
|
+
const mdown = ( new MarkdownString(undefined, { isTrusted: true })).appendMarkdown(message);
|
|
231
|
+
this.hintContainer.setLabel('$(warning)', undefined, { title: { markdown: mdown, markdownNotSupportedFallback: message } });
|
|
232
|
+
dom.show(this.hintContainer.element);
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
this.hintDelayer.schedule();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
dom.hide(this.hintContainer.element);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
onBreakpointsChange() {
|
|
243
|
+
if (this.isBodyVisible()) {
|
|
244
|
+
this.updateSize();
|
|
245
|
+
if (this.list) {
|
|
246
|
+
const lastFocusIndex = this.list.getFocus()[0];
|
|
247
|
+
const needsRefocus = lastFocusIndex && !this.elements.includes(this.list.element(lastFocusIndex));
|
|
248
|
+
this.list.splice(0, this.list.length, this.elements);
|
|
249
|
+
this.needsRefresh = false;
|
|
250
|
+
if (needsRefocus) {
|
|
251
|
+
this.list.focusNth(Math.min(lastFocusIndex, this.list.length - 1));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
this.updateBreakpointsHint();
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
this.needsRefresh = true;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
onStateChange() {
|
|
261
|
+
if (this.isBodyVisible()) {
|
|
262
|
+
this.needsStateChange = false;
|
|
263
|
+
const thread = this.debugService.getViewModel().focusedThread;
|
|
264
|
+
let found = false;
|
|
265
|
+
if (thread && thread.stoppedDetails && thread.stoppedDetails.hitBreakpointIds && thread.stoppedDetails.hitBreakpointIds.length > 0) {
|
|
266
|
+
const hitBreakpointIds = thread.stoppedDetails.hitBreakpointIds;
|
|
267
|
+
const elements = this.elements;
|
|
268
|
+
const index = elements.findIndex(e => {
|
|
269
|
+
const id = e.getIdFromAdapter(thread.session.getId());
|
|
270
|
+
return typeof id === 'number' && hitBreakpointIds.indexOf(id) !== -1;
|
|
271
|
+
});
|
|
272
|
+
if (index >= 0) {
|
|
273
|
+
this.list.setFocus([index]);
|
|
274
|
+
this.list.setSelection([index]);
|
|
275
|
+
found = true;
|
|
276
|
+
this.autoFocusedIndex = index;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (!found) {
|
|
280
|
+
const focus = this.list.getFocus();
|
|
281
|
+
const selection = this.list.getSelection();
|
|
282
|
+
if (this.autoFocusedIndex >= 0 && equals(focus, selection) && focus.indexOf(this.autoFocusedIndex) >= 0) {
|
|
283
|
+
this.list.setFocus([]);
|
|
284
|
+
this.list.setSelection([]);
|
|
285
|
+
}
|
|
286
|
+
this.autoFocusedIndex = -1;
|
|
287
|
+
}
|
|
288
|
+
this.updateBreakpointsHint();
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
this.needsStateChange = true;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
get elements() {
|
|
295
|
+
const model = this.debugService.getModel();
|
|
296
|
+
const sessionId = this.debugService.getViewModel().focusedSession?.getId();
|
|
297
|
+
const elements = model.getExceptionBreakpointsForSession(sessionId).concat(model.getFunctionBreakpoints()).concat(model.getDataBreakpoints()).concat(model.getBreakpoints()).concat(model.getInstructionBreakpoints());
|
|
298
|
+
return elements;
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
BreakpointsView = ( __decorate([
|
|
302
|
+
( __param(1, IContextMenuService)),
|
|
303
|
+
( __param(2, IDebugService)),
|
|
304
|
+
( __param(3, IKeybindingService)),
|
|
305
|
+
( __param(4, IInstantiationService)),
|
|
306
|
+
( __param(5, IThemeService)),
|
|
307
|
+
( __param(6, IEditorService)),
|
|
308
|
+
( __param(7, IContextViewService)),
|
|
309
|
+
( __param(8, IConfigurationService)),
|
|
310
|
+
( __param(9, IViewDescriptorService)),
|
|
311
|
+
( __param(10, IContextKeyService)),
|
|
312
|
+
( __param(11, IOpenerService)),
|
|
313
|
+
( __param(12, ITelemetryService)),
|
|
314
|
+
( __param(13, ILabelService)),
|
|
315
|
+
( __param(14, IMenuService)),
|
|
316
|
+
( __param(15, IHoverService)),
|
|
317
|
+
( __param(16, ILanguageService))
|
|
318
|
+
], BreakpointsView));
|
|
319
|
+
class BreakpointsDelegate {
|
|
320
|
+
constructor(view) {
|
|
321
|
+
this.view = view;
|
|
322
|
+
}
|
|
323
|
+
getHeight(_element) {
|
|
324
|
+
return 22;
|
|
325
|
+
}
|
|
326
|
+
getTemplateId(element) {
|
|
327
|
+
if (element instanceof Breakpoint) {
|
|
328
|
+
return BreakpointsRenderer.ID;
|
|
329
|
+
}
|
|
330
|
+
if (element instanceof FunctionBreakpoint) {
|
|
331
|
+
const inputBoxBreakpoint = this.view.inputBoxData?.breakpoint;
|
|
332
|
+
if (!element.name || (inputBoxBreakpoint && inputBoxBreakpoint.getId() === element.getId())) {
|
|
333
|
+
return FunctionBreakpointInputRenderer.ID;
|
|
334
|
+
}
|
|
335
|
+
return FunctionBreakpointsRenderer.ID;
|
|
336
|
+
}
|
|
337
|
+
if (element instanceof ExceptionBreakpoint) {
|
|
338
|
+
const inputBoxBreakpoint = this.view.inputBoxData?.breakpoint;
|
|
339
|
+
if (inputBoxBreakpoint && inputBoxBreakpoint.getId() === element.getId()) {
|
|
340
|
+
return ExceptionBreakpointInputRenderer.ID;
|
|
341
|
+
}
|
|
342
|
+
return ExceptionBreakpointsRenderer.ID;
|
|
343
|
+
}
|
|
344
|
+
if (element instanceof DataBreakpoint) {
|
|
345
|
+
return DataBreakpointsRenderer.ID;
|
|
346
|
+
}
|
|
347
|
+
if (element instanceof InstructionBreakpoint) {
|
|
348
|
+
return InstructionBreakpointsRenderer.ID;
|
|
349
|
+
}
|
|
350
|
+
return '';
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
const breakpointIdToActionBarDomeNode = ( new Map());
|
|
354
|
+
let BreakpointsRenderer = class BreakpointsRenderer {
|
|
355
|
+
static { BreakpointsRenderer_1 = this; }
|
|
356
|
+
constructor(menu, breakpointSupportsCondition, breakpointItemType, debugService, labelService) {
|
|
357
|
+
this.menu = menu;
|
|
358
|
+
this.breakpointSupportsCondition = breakpointSupportsCondition;
|
|
359
|
+
this.breakpointItemType = breakpointItemType;
|
|
360
|
+
this.debugService = debugService;
|
|
361
|
+
this.labelService = labelService;
|
|
362
|
+
}
|
|
363
|
+
static { this.ID = 'breakpoints'; }
|
|
364
|
+
get templateId() {
|
|
365
|
+
return BreakpointsRenderer_1.ID;
|
|
366
|
+
}
|
|
367
|
+
renderTemplate(container) {
|
|
368
|
+
const data = Object.create(null);
|
|
369
|
+
data.toDispose = [];
|
|
370
|
+
data.breakpoint = dom.append(container, $('.breakpoint'));
|
|
371
|
+
data.icon = $('.icon');
|
|
372
|
+
data.checkbox = createCheckbox(data.toDispose);
|
|
373
|
+
data.toDispose.push(dom.addStandardDisposableListener(data.checkbox, 'change', (e) => {
|
|
374
|
+
this.debugService.enableOrDisableBreakpoints(!data.context.enabled, data.context);
|
|
375
|
+
}));
|
|
376
|
+
dom.append(data.breakpoint, data.icon);
|
|
377
|
+
dom.append(data.breakpoint, data.checkbox);
|
|
378
|
+
data.name = dom.append(data.breakpoint, $('span.name'));
|
|
379
|
+
data.filePath = dom.append(data.breakpoint, $('span.file-path'));
|
|
380
|
+
data.actionBar = ( new ActionBar(data.breakpoint));
|
|
381
|
+
data.toDispose.push(data.actionBar);
|
|
382
|
+
const lineNumberContainer = dom.append(data.breakpoint, $('.line-number-container'));
|
|
383
|
+
data.lineNumber = dom.append(lineNumberContainer, $('span.line-number.monaco-count-badge'));
|
|
384
|
+
return data;
|
|
385
|
+
}
|
|
386
|
+
renderElement(breakpoint, index, data) {
|
|
387
|
+
data.context = breakpoint;
|
|
388
|
+
data.breakpoint.classList.toggle('disabled', !this.debugService.getModel().areBreakpointsActivated());
|
|
389
|
+
data.name.textContent = resources.basenameOrAuthority(breakpoint.uri);
|
|
390
|
+
data.lineNumber.textContent = ( breakpoint.lineNumber.toString());
|
|
391
|
+
if (breakpoint.column) {
|
|
392
|
+
data.lineNumber.textContent += `:${breakpoint.column}`;
|
|
393
|
+
}
|
|
394
|
+
data.filePath.textContent = this.labelService.getUriLabel(resources.dirname(breakpoint.uri), { relative: true });
|
|
395
|
+
data.checkbox.checked = breakpoint.enabled;
|
|
396
|
+
const { message, icon } = getBreakpointMessageAndIcon(this.debugService.state, this.debugService.getModel().areBreakpointsActivated(), breakpoint, this.labelService);
|
|
397
|
+
data.icon.className = ThemeIcon.asClassName(icon);
|
|
398
|
+
data.breakpoint.title = breakpoint.message || message || '';
|
|
399
|
+
const debugActive = this.debugService.state === 3 || this.debugService.state === 2 ;
|
|
400
|
+
if (debugActive && !breakpoint.verified) {
|
|
401
|
+
data.breakpoint.classList.add('disabled');
|
|
402
|
+
}
|
|
403
|
+
const primary = [];
|
|
404
|
+
const session = this.debugService.getViewModel().focusedSession;
|
|
405
|
+
this.breakpointSupportsCondition.set(!session || !!session.capabilities.supportsConditionalBreakpoints);
|
|
406
|
+
this.breakpointItemType.set('breakpoint');
|
|
407
|
+
createAndFillInActionBarActions(this.menu, { arg: breakpoint, shouldForwardArgs: true }, { primary, secondary: [] }, 'inline');
|
|
408
|
+
data.actionBar.clear();
|
|
409
|
+
data.actionBar.push(primary, { icon: true, label: false });
|
|
410
|
+
breakpointIdToActionBarDomeNode.set(breakpoint.getId(), data.actionBar.domNode);
|
|
411
|
+
}
|
|
412
|
+
disposeTemplate(templateData) {
|
|
413
|
+
dispose(templateData.toDispose);
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
BreakpointsRenderer = BreakpointsRenderer_1 = ( __decorate([
|
|
417
|
+
( __param(3, IDebugService)),
|
|
418
|
+
( __param(4, ILabelService))
|
|
419
|
+
], BreakpointsRenderer));
|
|
420
|
+
class ExceptionBreakpointsRenderer {
|
|
421
|
+
constructor(menu, breakpointSupportsCondition, breakpointItemType, debugService) {
|
|
422
|
+
this.menu = menu;
|
|
423
|
+
this.breakpointSupportsCondition = breakpointSupportsCondition;
|
|
424
|
+
this.breakpointItemType = breakpointItemType;
|
|
425
|
+
this.debugService = debugService;
|
|
426
|
+
}
|
|
427
|
+
static { this.ID = 'exceptionbreakpoints'; }
|
|
428
|
+
get templateId() {
|
|
429
|
+
return ExceptionBreakpointsRenderer.ID;
|
|
430
|
+
}
|
|
431
|
+
renderTemplate(container) {
|
|
432
|
+
const data = Object.create(null);
|
|
433
|
+
data.toDispose = [];
|
|
434
|
+
data.breakpoint = dom.append(container, $('.breakpoint'));
|
|
435
|
+
data.checkbox = createCheckbox(data.toDispose);
|
|
436
|
+
data.toDispose.push(dom.addStandardDisposableListener(data.checkbox, 'change', (e) => {
|
|
437
|
+
this.debugService.enableOrDisableBreakpoints(!data.context.enabled, data.context);
|
|
438
|
+
}));
|
|
439
|
+
dom.append(data.breakpoint, data.checkbox);
|
|
440
|
+
data.name = dom.append(data.breakpoint, $('span.name'));
|
|
441
|
+
data.condition = dom.append(data.breakpoint, $('span.condition'));
|
|
442
|
+
data.breakpoint.classList.add('exception');
|
|
443
|
+
data.actionBar = ( new ActionBar(data.breakpoint));
|
|
444
|
+
data.toDispose.push(data.actionBar);
|
|
445
|
+
return data;
|
|
446
|
+
}
|
|
447
|
+
renderElement(exceptionBreakpoint, index, data) {
|
|
448
|
+
data.context = exceptionBreakpoint;
|
|
449
|
+
data.name.textContent = exceptionBreakpoint.label || `${exceptionBreakpoint.filter} exceptions`;
|
|
450
|
+
data.breakpoint.title = exceptionBreakpoint.verified ? (exceptionBreakpoint.description || data.name.textContent) : exceptionBreakpoint.message || ( localize('unverifiedExceptionBreakpoint', "Unverified Exception Breakpoint"));
|
|
451
|
+
data.breakpoint.classList.toggle('disabled', !exceptionBreakpoint.verified);
|
|
452
|
+
data.checkbox.checked = exceptionBreakpoint.enabled;
|
|
453
|
+
data.condition.textContent = exceptionBreakpoint.condition || '';
|
|
454
|
+
data.condition.title = ( localize(
|
|
455
|
+
'expressionCondition',
|
|
456
|
+
"Expression condition: {0}",
|
|
457
|
+
exceptionBreakpoint.condition
|
|
458
|
+
));
|
|
459
|
+
const primary = [];
|
|
460
|
+
this.breakpointSupportsCondition.set(exceptionBreakpoint.supportsCondition);
|
|
461
|
+
this.breakpointItemType.set('exceptionBreakpoint');
|
|
462
|
+
createAndFillInActionBarActions(this.menu, { arg: exceptionBreakpoint, shouldForwardArgs: true }, { primary, secondary: [] }, 'inline');
|
|
463
|
+
data.actionBar.clear();
|
|
464
|
+
data.actionBar.push(primary, { icon: true, label: false });
|
|
465
|
+
breakpointIdToActionBarDomeNode.set(exceptionBreakpoint.getId(), data.actionBar.domNode);
|
|
466
|
+
}
|
|
467
|
+
disposeTemplate(templateData) {
|
|
468
|
+
dispose(templateData.toDispose);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
let FunctionBreakpointsRenderer = class FunctionBreakpointsRenderer {
|
|
472
|
+
static { FunctionBreakpointsRenderer_1 = this; }
|
|
473
|
+
constructor(menu, breakpointSupportsCondition, breakpointItemType, debugService, labelService) {
|
|
474
|
+
this.menu = menu;
|
|
475
|
+
this.breakpointSupportsCondition = breakpointSupportsCondition;
|
|
476
|
+
this.breakpointItemType = breakpointItemType;
|
|
477
|
+
this.debugService = debugService;
|
|
478
|
+
this.labelService = labelService;
|
|
479
|
+
}
|
|
480
|
+
static { this.ID = 'functionbreakpoints'; }
|
|
481
|
+
get templateId() {
|
|
482
|
+
return FunctionBreakpointsRenderer_1.ID;
|
|
483
|
+
}
|
|
484
|
+
renderTemplate(container) {
|
|
485
|
+
const data = Object.create(null);
|
|
486
|
+
data.toDispose = [];
|
|
487
|
+
data.breakpoint = dom.append(container, $('.breakpoint'));
|
|
488
|
+
data.icon = $('.icon');
|
|
489
|
+
data.checkbox = createCheckbox(data.toDispose);
|
|
490
|
+
data.toDispose.push(dom.addStandardDisposableListener(data.checkbox, 'change', (e) => {
|
|
491
|
+
this.debugService.enableOrDisableBreakpoints(!data.context.enabled, data.context);
|
|
492
|
+
}));
|
|
493
|
+
dom.append(data.breakpoint, data.icon);
|
|
494
|
+
dom.append(data.breakpoint, data.checkbox);
|
|
495
|
+
data.name = dom.append(data.breakpoint, $('span.name'));
|
|
496
|
+
data.condition = dom.append(data.breakpoint, $('span.condition'));
|
|
497
|
+
data.actionBar = ( new ActionBar(data.breakpoint));
|
|
498
|
+
data.toDispose.push(data.actionBar);
|
|
499
|
+
return data;
|
|
500
|
+
}
|
|
501
|
+
renderElement(functionBreakpoint, _index, data) {
|
|
502
|
+
data.context = functionBreakpoint;
|
|
503
|
+
data.name.textContent = functionBreakpoint.name;
|
|
504
|
+
const { icon, message } = getBreakpointMessageAndIcon(this.debugService.state, this.debugService.getModel().areBreakpointsActivated(), functionBreakpoint, this.labelService);
|
|
505
|
+
data.icon.className = ThemeIcon.asClassName(icon);
|
|
506
|
+
data.icon.title = message ? message : '';
|
|
507
|
+
data.checkbox.checked = functionBreakpoint.enabled;
|
|
508
|
+
data.breakpoint.title = message ? message : '';
|
|
509
|
+
if (functionBreakpoint.condition && functionBreakpoint.hitCondition) {
|
|
510
|
+
data.condition.textContent = ( localize(
|
|
511
|
+
'expressionAndHitCount',
|
|
512
|
+
"Expression: {0} | Hit Count: {1}",
|
|
513
|
+
functionBreakpoint.condition,
|
|
514
|
+
functionBreakpoint.hitCondition
|
|
515
|
+
));
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
data.condition.textContent = functionBreakpoint.condition || functionBreakpoint.hitCondition || '';
|
|
519
|
+
}
|
|
520
|
+
const session = this.debugService.getViewModel().focusedSession;
|
|
521
|
+
data.breakpoint.classList.toggle('disabled', (session && !session.capabilities.supportsFunctionBreakpoints) || !this.debugService.getModel().areBreakpointsActivated());
|
|
522
|
+
if (session && !session.capabilities.supportsFunctionBreakpoints) {
|
|
523
|
+
data.breakpoint.title = ( localize(
|
|
524
|
+
'functionBreakpointsNotSupported',
|
|
525
|
+
"Function breakpoints are not supported by this debug type"
|
|
526
|
+
));
|
|
527
|
+
}
|
|
528
|
+
const primary = [];
|
|
529
|
+
this.breakpointSupportsCondition.set(!session || !!session.capabilities.supportsConditionalBreakpoints);
|
|
530
|
+
this.breakpointItemType.set('functionBreakpoint');
|
|
531
|
+
createAndFillInActionBarActions(this.menu, { arg: functionBreakpoint, shouldForwardArgs: true }, { primary, secondary: [] }, 'inline');
|
|
532
|
+
data.actionBar.clear();
|
|
533
|
+
data.actionBar.push(primary, { icon: true, label: false });
|
|
534
|
+
breakpointIdToActionBarDomeNode.set(functionBreakpoint.getId(), data.actionBar.domNode);
|
|
535
|
+
}
|
|
536
|
+
disposeTemplate(templateData) {
|
|
537
|
+
dispose(templateData.toDispose);
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
FunctionBreakpointsRenderer = FunctionBreakpointsRenderer_1 = ( __decorate([
|
|
541
|
+
( __param(3, IDebugService)),
|
|
542
|
+
( __param(4, ILabelService))
|
|
543
|
+
], FunctionBreakpointsRenderer));
|
|
544
|
+
let DataBreakpointsRenderer = class DataBreakpointsRenderer {
|
|
545
|
+
static { DataBreakpointsRenderer_1 = this; }
|
|
546
|
+
constructor(debugService, labelService) {
|
|
547
|
+
this.debugService = debugService;
|
|
548
|
+
this.labelService = labelService;
|
|
549
|
+
}
|
|
550
|
+
static { this.ID = 'databreakpoints'; }
|
|
551
|
+
get templateId() {
|
|
552
|
+
return DataBreakpointsRenderer_1.ID;
|
|
553
|
+
}
|
|
554
|
+
renderTemplate(container) {
|
|
555
|
+
const data = Object.create(null);
|
|
556
|
+
data.breakpoint = dom.append(container, $('.breakpoint'));
|
|
557
|
+
data.toDispose = [];
|
|
558
|
+
data.icon = $('.icon');
|
|
559
|
+
data.checkbox = createCheckbox(data.toDispose);
|
|
560
|
+
data.toDispose.push(dom.addStandardDisposableListener(data.checkbox, 'change', (e) => {
|
|
561
|
+
this.debugService.enableOrDisableBreakpoints(!data.context.enabled, data.context);
|
|
562
|
+
}));
|
|
563
|
+
dom.append(data.breakpoint, data.icon);
|
|
564
|
+
dom.append(data.breakpoint, data.checkbox);
|
|
565
|
+
data.name = dom.append(data.breakpoint, $('span.name'));
|
|
566
|
+
data.accessType = dom.append(data.breakpoint, $('span.access-type'));
|
|
567
|
+
return data;
|
|
568
|
+
}
|
|
569
|
+
renderElement(dataBreakpoint, _index, data) {
|
|
570
|
+
data.context = dataBreakpoint;
|
|
571
|
+
data.name.textContent = dataBreakpoint.description;
|
|
572
|
+
const { icon, message } = getBreakpointMessageAndIcon(this.debugService.state, this.debugService.getModel().areBreakpointsActivated(), dataBreakpoint, this.labelService);
|
|
573
|
+
data.icon.className = ThemeIcon.asClassName(icon);
|
|
574
|
+
data.icon.title = message ? message : '';
|
|
575
|
+
data.checkbox.checked = dataBreakpoint.enabled;
|
|
576
|
+
data.breakpoint.title = message ? message : '';
|
|
577
|
+
const session = this.debugService.getViewModel().focusedSession;
|
|
578
|
+
data.breakpoint.classList.toggle('disabled', (session && !session.capabilities.supportsDataBreakpoints) || !this.debugService.getModel().areBreakpointsActivated());
|
|
579
|
+
if (session && !session.capabilities.supportsDataBreakpoints) {
|
|
580
|
+
data.breakpoint.title = ( localize(
|
|
581
|
+
'dataBreakpointsNotSupported',
|
|
582
|
+
"Data breakpoints are not supported by this debug type"
|
|
583
|
+
));
|
|
584
|
+
}
|
|
585
|
+
if (dataBreakpoint.accessType) {
|
|
586
|
+
const accessType = dataBreakpoint.accessType === 'read' ? ( localize('read', "Read")) : dataBreakpoint.accessType === 'write' ? ( localize('write', "Write")) : ( localize('access', "Access"));
|
|
587
|
+
data.accessType.textContent = accessType;
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
data.accessType.textContent = '';
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
disposeTemplate(templateData) {
|
|
594
|
+
dispose(templateData.toDispose);
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
DataBreakpointsRenderer = DataBreakpointsRenderer_1 = ( __decorate([
|
|
598
|
+
( __param(0, IDebugService)),
|
|
599
|
+
( __param(1, ILabelService))
|
|
600
|
+
], DataBreakpointsRenderer));
|
|
601
|
+
let InstructionBreakpointsRenderer = class InstructionBreakpointsRenderer {
|
|
602
|
+
static { InstructionBreakpointsRenderer_1 = this; }
|
|
603
|
+
constructor(debugService, labelService) {
|
|
604
|
+
this.debugService = debugService;
|
|
605
|
+
this.labelService = labelService;
|
|
606
|
+
}
|
|
607
|
+
static { this.ID = 'instructionBreakpoints'; }
|
|
608
|
+
get templateId() {
|
|
609
|
+
return InstructionBreakpointsRenderer_1.ID;
|
|
610
|
+
}
|
|
611
|
+
renderTemplate(container) {
|
|
612
|
+
const data = Object.create(null);
|
|
613
|
+
data.toDispose = [];
|
|
614
|
+
data.breakpoint = dom.append(container, $('.breakpoint'));
|
|
615
|
+
data.icon = $('.icon');
|
|
616
|
+
data.checkbox = createCheckbox(data.toDispose);
|
|
617
|
+
data.toDispose.push(dom.addStandardDisposableListener(data.checkbox, 'change', (e) => {
|
|
618
|
+
this.debugService.enableOrDisableBreakpoints(!data.context.enabled, data.context);
|
|
619
|
+
}));
|
|
620
|
+
dom.append(data.breakpoint, data.icon);
|
|
621
|
+
dom.append(data.breakpoint, data.checkbox);
|
|
622
|
+
data.name = dom.append(data.breakpoint, $('span.name'));
|
|
623
|
+
data.address = dom.append(data.breakpoint, $('span.file-path'));
|
|
624
|
+
data.actionBar = ( new ActionBar(data.breakpoint));
|
|
625
|
+
data.toDispose.push(data.actionBar);
|
|
626
|
+
return data;
|
|
627
|
+
}
|
|
628
|
+
renderElement(breakpoint, index, data) {
|
|
629
|
+
data.context = breakpoint;
|
|
630
|
+
data.breakpoint.classList.toggle('disabled', !this.debugService.getModel().areBreakpointsActivated());
|
|
631
|
+
data.name.textContent = breakpoint.instructionReference;
|
|
632
|
+
data.checkbox.checked = breakpoint.enabled;
|
|
633
|
+
const { message, icon } = getBreakpointMessageAndIcon(this.debugService.state, this.debugService.getModel().areBreakpointsActivated(), breakpoint, this.labelService);
|
|
634
|
+
data.icon.className = ThemeIcon.asClassName(icon);
|
|
635
|
+
data.breakpoint.title = breakpoint.message || message || '';
|
|
636
|
+
const debugActive = this.debugService.state === 3 || this.debugService.state === 2 ;
|
|
637
|
+
if (debugActive && !breakpoint.verified) {
|
|
638
|
+
data.breakpoint.classList.add('disabled');
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
disposeTemplate(templateData) {
|
|
642
|
+
dispose(templateData.toDispose);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
InstructionBreakpointsRenderer = InstructionBreakpointsRenderer_1 = ( __decorate([
|
|
646
|
+
( __param(0, IDebugService)),
|
|
647
|
+
( __param(1, ILabelService))
|
|
648
|
+
], InstructionBreakpointsRenderer));
|
|
649
|
+
class FunctionBreakpointInputRenderer {
|
|
650
|
+
constructor(view, debugService, contextViewService, labelService) {
|
|
651
|
+
this.view = view;
|
|
652
|
+
this.debugService = debugService;
|
|
653
|
+
this.contextViewService = contextViewService;
|
|
654
|
+
this.labelService = labelService;
|
|
655
|
+
}
|
|
656
|
+
static { this.ID = 'functionbreakpointinput'; }
|
|
657
|
+
get templateId() {
|
|
658
|
+
return FunctionBreakpointInputRenderer.ID;
|
|
659
|
+
}
|
|
660
|
+
renderTemplate(container) {
|
|
661
|
+
const template = Object.create(null);
|
|
662
|
+
const toDispose = [];
|
|
663
|
+
const breakpoint = dom.append(container, $('.breakpoint'));
|
|
664
|
+
template.icon = $('.icon');
|
|
665
|
+
template.checkbox = createCheckbox(toDispose);
|
|
666
|
+
dom.append(breakpoint, template.icon);
|
|
667
|
+
dom.append(breakpoint, template.checkbox);
|
|
668
|
+
this.view.breakpointInputFocused.set(true);
|
|
669
|
+
const inputBoxContainer = dom.append(breakpoint, $('.inputBoxContainer'));
|
|
670
|
+
const inputBox = ( new InputBox(
|
|
671
|
+
inputBoxContainer,
|
|
672
|
+
this.contextViewService,
|
|
673
|
+
{ inputBoxStyles: defaultInputBoxStyles }
|
|
674
|
+
));
|
|
675
|
+
const wrapUp = (success) => {
|
|
676
|
+
template.updating = true;
|
|
677
|
+
try {
|
|
678
|
+
this.view.breakpointInputFocused.set(false);
|
|
679
|
+
const id = template.breakpoint.getId();
|
|
680
|
+
if (success) {
|
|
681
|
+
if (template.type === 'name') {
|
|
682
|
+
this.debugService.updateFunctionBreakpoint(id, { name: inputBox.value });
|
|
683
|
+
}
|
|
684
|
+
if (template.type === 'condition') {
|
|
685
|
+
this.debugService.updateFunctionBreakpoint(id, { condition: inputBox.value });
|
|
686
|
+
}
|
|
687
|
+
if (template.type === 'hitCount') {
|
|
688
|
+
this.debugService.updateFunctionBreakpoint(id, { hitCondition: inputBox.value });
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
692
|
+
if (template.type === 'name' && !template.breakpoint.name) {
|
|
693
|
+
this.debugService.removeFunctionBreakpoints(id);
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
this.view.renderInputBox(undefined);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
finally {
|
|
701
|
+
template.updating = false;
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
toDispose.push(dom.addStandardDisposableListener(inputBox.inputElement, 'keydown', (e) => {
|
|
705
|
+
const isEscape = e.equals(9 );
|
|
706
|
+
const isEnter = e.equals(3 );
|
|
707
|
+
if (isEscape || isEnter) {
|
|
708
|
+
e.preventDefault();
|
|
709
|
+
e.stopPropagation();
|
|
710
|
+
wrapUp(isEnter);
|
|
711
|
+
}
|
|
712
|
+
}));
|
|
713
|
+
toDispose.push(dom.addDisposableListener(inputBox.inputElement, 'blur', () => {
|
|
714
|
+
if (!template.updating) {
|
|
715
|
+
wrapUp(!!inputBox.value);
|
|
716
|
+
}
|
|
717
|
+
}));
|
|
718
|
+
template.inputBox = inputBox;
|
|
719
|
+
template.toDispose = toDispose;
|
|
720
|
+
return template;
|
|
721
|
+
}
|
|
722
|
+
renderElement(functionBreakpoint, _index, data) {
|
|
723
|
+
data.breakpoint = functionBreakpoint;
|
|
724
|
+
data.type = this.view.inputBoxData?.type || 'name';
|
|
725
|
+
const { icon, message } = getBreakpointMessageAndIcon(this.debugService.state, this.debugService.getModel().areBreakpointsActivated(), functionBreakpoint, this.labelService);
|
|
726
|
+
data.icon.className = ThemeIcon.asClassName(icon);
|
|
727
|
+
data.icon.title = message ? message : '';
|
|
728
|
+
data.checkbox.checked = functionBreakpoint.enabled;
|
|
729
|
+
data.checkbox.disabled = true;
|
|
730
|
+
data.inputBox.value = functionBreakpoint.name || '';
|
|
731
|
+
let placeholder = ( localize('functionBreakpointPlaceholder', "Function to break on"));
|
|
732
|
+
let ariaLabel = ( localize('functionBreakPointInputAriaLabel', "Type function breakpoint."));
|
|
733
|
+
if (data.type === 'condition') {
|
|
734
|
+
data.inputBox.value = functionBreakpoint.condition || '';
|
|
735
|
+
placeholder = ( localize(
|
|
736
|
+
'functionBreakpointExpressionPlaceholder',
|
|
737
|
+
"Break when expression evaluates to true"
|
|
738
|
+
));
|
|
739
|
+
ariaLabel = ( localize(
|
|
740
|
+
'functionBreakPointExpresionAriaLabel',
|
|
741
|
+
"Type expression. Function breakpoint will break when expression evaluates to true"
|
|
742
|
+
));
|
|
743
|
+
}
|
|
744
|
+
else if (data.type === 'hitCount') {
|
|
745
|
+
data.inputBox.value = functionBreakpoint.hitCondition || '';
|
|
746
|
+
placeholder = ( localize('functionBreakpointHitCountPlaceholder', "Break when hit count is met"));
|
|
747
|
+
ariaLabel = ( localize(
|
|
748
|
+
'functionBreakPointHitCountAriaLabel',
|
|
749
|
+
"Type hit count. Function breakpoint will break when hit count is met."
|
|
750
|
+
));
|
|
751
|
+
}
|
|
752
|
+
data.inputBox.setAriaLabel(ariaLabel);
|
|
753
|
+
data.inputBox.setPlaceHolder(placeholder);
|
|
754
|
+
setTimeout(() => {
|
|
755
|
+
data.inputBox.focus();
|
|
756
|
+
data.inputBox.select();
|
|
757
|
+
}, 0);
|
|
758
|
+
}
|
|
759
|
+
disposeTemplate(templateData) {
|
|
760
|
+
dispose(templateData.toDispose);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
class ExceptionBreakpointInputRenderer {
|
|
764
|
+
constructor(view, debugService, contextViewService) {
|
|
765
|
+
this.view = view;
|
|
766
|
+
this.debugService = debugService;
|
|
767
|
+
this.contextViewService = contextViewService;
|
|
768
|
+
}
|
|
769
|
+
static { this.ID = 'exceptionbreakpointinput'; }
|
|
770
|
+
get templateId() {
|
|
771
|
+
return ExceptionBreakpointInputRenderer.ID;
|
|
772
|
+
}
|
|
773
|
+
renderTemplate(container) {
|
|
774
|
+
const template = Object.create(null);
|
|
775
|
+
const toDispose = [];
|
|
776
|
+
const breakpoint = dom.append(container, $('.breakpoint'));
|
|
777
|
+
breakpoint.classList.add('exception');
|
|
778
|
+
template.checkbox = createCheckbox(toDispose);
|
|
779
|
+
dom.append(breakpoint, template.checkbox);
|
|
780
|
+
this.view.breakpointInputFocused.set(true);
|
|
781
|
+
const inputBoxContainer = dom.append(breakpoint, $('.inputBoxContainer'));
|
|
782
|
+
const inputBox = ( new InputBox(inputBoxContainer, this.contextViewService, {
|
|
783
|
+
ariaLabel: ( localize('exceptionBreakpointAriaLabel', "Type exception breakpoint condition")),
|
|
784
|
+
inputBoxStyles: defaultInputBoxStyles
|
|
785
|
+
}));
|
|
786
|
+
const wrapUp = (success) => {
|
|
787
|
+
this.view.breakpointInputFocused.set(false);
|
|
788
|
+
let newCondition = template.breakpoint.condition;
|
|
789
|
+
if (success) {
|
|
790
|
+
newCondition = inputBox.value !== '' ? inputBox.value : undefined;
|
|
791
|
+
}
|
|
792
|
+
this.debugService.setExceptionBreakpointCondition(template.breakpoint, newCondition);
|
|
793
|
+
};
|
|
794
|
+
toDispose.push(dom.addStandardDisposableListener(inputBox.inputElement, 'keydown', (e) => {
|
|
795
|
+
const isEscape = e.equals(9 );
|
|
796
|
+
const isEnter = e.equals(3 );
|
|
797
|
+
if (isEscape || isEnter) {
|
|
798
|
+
e.preventDefault();
|
|
799
|
+
e.stopPropagation();
|
|
800
|
+
wrapUp(isEnter);
|
|
801
|
+
}
|
|
802
|
+
}));
|
|
803
|
+
toDispose.push(dom.addDisposableListener(inputBox.inputElement, 'blur', () => {
|
|
804
|
+
setTimeout(() => {
|
|
805
|
+
wrapUp(true);
|
|
806
|
+
});
|
|
807
|
+
}));
|
|
808
|
+
template.inputBox = inputBox;
|
|
809
|
+
template.toDispose = toDispose;
|
|
810
|
+
return template;
|
|
811
|
+
}
|
|
812
|
+
renderElement(exceptionBreakpoint, _index, data) {
|
|
813
|
+
const placeHolder = exceptionBreakpoint.conditionDescription || ( localize(
|
|
814
|
+
'exceptionBreakpointPlaceholder',
|
|
815
|
+
"Break when expression evaluates to true"
|
|
816
|
+
));
|
|
817
|
+
data.inputBox.setPlaceHolder(placeHolder);
|
|
818
|
+
data.breakpoint = exceptionBreakpoint;
|
|
819
|
+
data.checkbox.checked = exceptionBreakpoint.enabled;
|
|
820
|
+
data.checkbox.disabled = true;
|
|
821
|
+
data.inputBox.value = exceptionBreakpoint.condition || '';
|
|
822
|
+
setTimeout(() => {
|
|
823
|
+
data.inputBox.focus();
|
|
824
|
+
data.inputBox.select();
|
|
825
|
+
}, 0);
|
|
826
|
+
}
|
|
827
|
+
disposeTemplate(templateData) {
|
|
828
|
+
dispose(templateData.toDispose);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
class BreakpointsAccessibilityProvider {
|
|
832
|
+
constructor(debugService, labelService) {
|
|
833
|
+
this.debugService = debugService;
|
|
834
|
+
this.labelService = labelService;
|
|
835
|
+
}
|
|
836
|
+
getWidgetAriaLabel() {
|
|
837
|
+
return ( localize('breakpoints', "Breakpoints"));
|
|
838
|
+
}
|
|
839
|
+
getRole() {
|
|
840
|
+
return 'checkbox';
|
|
841
|
+
}
|
|
842
|
+
isChecked(breakpoint) {
|
|
843
|
+
return breakpoint.enabled;
|
|
844
|
+
}
|
|
845
|
+
getAriaLabel(element) {
|
|
846
|
+
if (element instanceof ExceptionBreakpoint) {
|
|
847
|
+
return ( element.toString());
|
|
848
|
+
}
|
|
849
|
+
const { message } = getBreakpointMessageAndIcon(this.debugService.state, this.debugService.getModel().areBreakpointsActivated(), element, this.labelService);
|
|
850
|
+
const toString = ( element.toString());
|
|
851
|
+
return message ? `${toString}, ${message}` : toString;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
function openBreakpointSource(breakpoint, sideBySide, preserveFocus, pinned, debugService, editorService) {
|
|
855
|
+
if (breakpoint.uri.scheme === DEBUG_SCHEME && debugService.state === 0 ) {
|
|
856
|
+
return Promise.resolve(undefined);
|
|
857
|
+
}
|
|
858
|
+
const selection = breakpoint.endLineNumber ? {
|
|
859
|
+
startLineNumber: breakpoint.lineNumber,
|
|
860
|
+
endLineNumber: breakpoint.endLineNumber,
|
|
861
|
+
startColumn: breakpoint.column || 1,
|
|
862
|
+
endColumn: breakpoint.endColumn || 1073741824
|
|
863
|
+
} : {
|
|
864
|
+
startLineNumber: breakpoint.lineNumber,
|
|
865
|
+
startColumn: breakpoint.column || 1,
|
|
866
|
+
endLineNumber: breakpoint.lineNumber,
|
|
867
|
+
endColumn: breakpoint.column || 1073741824
|
|
868
|
+
};
|
|
869
|
+
return editorService.openEditor({
|
|
870
|
+
resource: breakpoint.uri,
|
|
871
|
+
options: {
|
|
872
|
+
preserveFocus,
|
|
873
|
+
selection,
|
|
874
|
+
revealIfOpened: true,
|
|
875
|
+
selectionRevealType: 1 ,
|
|
876
|
+
pinned
|
|
877
|
+
}
|
|
878
|
+
}, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
|
|
879
|
+
}
|
|
880
|
+
function getBreakpointMessageAndIcon(state, breakpointsActivated, breakpoint$1, labelService) {
|
|
881
|
+
const debugActive = state === 3 || state === 2 ;
|
|
882
|
+
const breakpointIcon = breakpoint$1 instanceof DataBreakpoint ? dataBreakpoint : breakpoint$1 instanceof FunctionBreakpoint ? functionBreakpoint : breakpoint$1.logMessage ? logBreakpoint : breakpoint;
|
|
883
|
+
if (!breakpoint$1.enabled || !breakpointsActivated) {
|
|
884
|
+
return {
|
|
885
|
+
icon: breakpointIcon.disabled,
|
|
886
|
+
message: breakpoint$1.logMessage ? ( localize('disabledLogpoint', "Disabled Logpoint")) : ( localize('disabledBreakpoint', "Disabled Breakpoint")),
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
const appendMessage = (text) => {
|
|
890
|
+
return ('message' in breakpoint$1 && breakpoint$1.message) ? text.concat(', ' + breakpoint$1.message) : text;
|
|
891
|
+
};
|
|
892
|
+
if (debugActive && !breakpoint$1.verified) {
|
|
893
|
+
return {
|
|
894
|
+
icon: breakpointIcon.unverified,
|
|
895
|
+
message: ('message' in breakpoint$1 && breakpoint$1.message) ? breakpoint$1.message : (breakpoint$1.logMessage ? ( localize('unverifiedLogpoint', "Unverified Logpoint")) : ( localize('unverifiedBreakpoint', "Unverified Breakpoint"))),
|
|
896
|
+
showAdapterUnverifiedMessage: true
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
if (breakpoint$1 instanceof DataBreakpoint) {
|
|
900
|
+
if (!breakpoint$1.supported) {
|
|
901
|
+
return {
|
|
902
|
+
icon: breakpointIcon.unverified,
|
|
903
|
+
message: ( localize(
|
|
904
|
+
'dataBreakpointUnsupported',
|
|
905
|
+
"Data breakpoints not supported by this debug type"
|
|
906
|
+
)),
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
return {
|
|
910
|
+
icon: breakpointIcon.regular,
|
|
911
|
+
message: breakpoint$1.message || ( localize('dataBreakpoint', "Data Breakpoint"))
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
if (breakpoint$1 instanceof FunctionBreakpoint) {
|
|
915
|
+
if (!breakpoint$1.supported) {
|
|
916
|
+
return {
|
|
917
|
+
icon: breakpointIcon.unverified,
|
|
918
|
+
message: ( localize(
|
|
919
|
+
'functionBreakpointUnsupported',
|
|
920
|
+
"Function breakpoints not supported by this debug type"
|
|
921
|
+
)),
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
const messages = [];
|
|
925
|
+
messages.push(breakpoint$1.message || ( localize('functionBreakpoint', "Function Breakpoint")));
|
|
926
|
+
if (breakpoint$1.condition) {
|
|
927
|
+
messages.push(( localize('expression', "Expression condition: {0}", breakpoint$1.condition)));
|
|
928
|
+
}
|
|
929
|
+
if (breakpoint$1.hitCondition) {
|
|
930
|
+
messages.push(( localize('hitCount', "Hit Count: {0}", breakpoint$1.hitCondition)));
|
|
931
|
+
}
|
|
932
|
+
return {
|
|
933
|
+
icon: breakpointIcon.regular,
|
|
934
|
+
message: appendMessage(messages.join('\n'))
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
if (breakpoint$1 instanceof InstructionBreakpoint) {
|
|
938
|
+
if (!breakpoint$1.supported) {
|
|
939
|
+
return {
|
|
940
|
+
icon: breakpointIcon.unverified,
|
|
941
|
+
message: ( localize(
|
|
942
|
+
'instructionBreakpointUnsupported',
|
|
943
|
+
"Instruction breakpoints not supported by this debug type"
|
|
944
|
+
)),
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
const messages = [];
|
|
948
|
+
if (breakpoint$1.message) {
|
|
949
|
+
messages.push(breakpoint$1.message);
|
|
950
|
+
}
|
|
951
|
+
else if (breakpoint$1.instructionReference) {
|
|
952
|
+
messages.push(( localize(
|
|
953
|
+
'instructionBreakpointAtAddress',
|
|
954
|
+
"Instruction breakpoint at address {0}",
|
|
955
|
+
breakpoint$1.instructionReference
|
|
956
|
+
)));
|
|
957
|
+
}
|
|
958
|
+
else {
|
|
959
|
+
messages.push(( localize('instructionBreakpoint', "Instruction breakpoint")));
|
|
960
|
+
}
|
|
961
|
+
if (breakpoint$1.hitCondition) {
|
|
962
|
+
messages.push(( localize('hitCount', "Hit Count: {0}", breakpoint$1.hitCondition)));
|
|
963
|
+
}
|
|
964
|
+
return {
|
|
965
|
+
icon: breakpointIcon.regular,
|
|
966
|
+
message: appendMessage(messages.join('\n'))
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
if (breakpoint$1.logMessage || breakpoint$1.condition || breakpoint$1.hitCondition) {
|
|
970
|
+
const messages = [];
|
|
971
|
+
if (!breakpoint$1.supported) {
|
|
972
|
+
return {
|
|
973
|
+
icon: debugBreakpointUnsupported,
|
|
974
|
+
message: ( localize(
|
|
975
|
+
'breakpointUnsupported',
|
|
976
|
+
"Breakpoints of this type are not supported by the debugger"
|
|
977
|
+
)),
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
if (breakpoint$1.logMessage) {
|
|
981
|
+
messages.push(( localize('logMessage', "Log Message: {0}", breakpoint$1.logMessage)));
|
|
982
|
+
}
|
|
983
|
+
if (breakpoint$1.condition) {
|
|
984
|
+
messages.push(( localize('expression', "Expression condition: {0}", breakpoint$1.condition)));
|
|
985
|
+
}
|
|
986
|
+
if (breakpoint$1.hitCondition) {
|
|
987
|
+
messages.push(( localize('hitCount', "Hit Count: {0}", breakpoint$1.hitCondition)));
|
|
988
|
+
}
|
|
989
|
+
return {
|
|
990
|
+
icon: breakpoint$1.logMessage ? logBreakpoint.regular : conditionalBreakpoint.regular,
|
|
991
|
+
message: appendMessage(messages.join('\n'))
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
const message = ('message' in breakpoint$1 && breakpoint$1.message) ? breakpoint$1.message : breakpoint$1 instanceof Breakpoint && labelService ? labelService.getUriLabel(breakpoint$1.uri) : ( localize('breakpoint', "Breakpoint"));
|
|
995
|
+
return {
|
|
996
|
+
icon: breakpointIcon.regular,
|
|
997
|
+
message
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
registerAction2(class extends Action2 {
|
|
1001
|
+
constructor() {
|
|
1002
|
+
super({
|
|
1003
|
+
id: 'workbench.debug.viewlet.action.addFunctionBreakpointAction',
|
|
1004
|
+
title: {
|
|
1005
|
+
value: ( localize('addFunctionBreakpoint', "Add Function Breakpoint")),
|
|
1006
|
+
original: 'Add Function Breakpoint',
|
|
1007
|
+
mnemonicTitle: ( localize(
|
|
1008
|
+
{ key: 'miFunctionBreakpoint', comment: ['&& denotes a mnemonic'] },
|
|
1009
|
+
"&&Function Breakpoint..."
|
|
1010
|
+
))
|
|
1011
|
+
},
|
|
1012
|
+
f1: true,
|
|
1013
|
+
icon: watchExpressionsAddFuncBreakpoint,
|
|
1014
|
+
menu: [{
|
|
1015
|
+
id: MenuId.ViewTitle,
|
|
1016
|
+
group: 'navigation',
|
|
1017
|
+
order: 10,
|
|
1018
|
+
when: ( ContextKeyExpr.equals('view', BREAKPOINTS_VIEW_ID))
|
|
1019
|
+
}, {
|
|
1020
|
+
id: MenuId.MenubarNewBreakpointMenu,
|
|
1021
|
+
group: '1_breakpoints',
|
|
1022
|
+
order: 3,
|
|
1023
|
+
when: CONTEXT_DEBUGGERS_AVAILABLE
|
|
1024
|
+
}]
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
run(accessor) {
|
|
1028
|
+
const debugService = accessor.get(IDebugService);
|
|
1029
|
+
debugService.addFunctionBreakpoint();
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
registerAction2(class extends Action2 {
|
|
1033
|
+
constructor() {
|
|
1034
|
+
super({
|
|
1035
|
+
id: 'workbench.debug.viewlet.action.toggleBreakpointsActivatedAction',
|
|
1036
|
+
title: { value: ( localize('activateBreakpoints', "Toggle Activate Breakpoints")), original: 'Toggle Activate Breakpoints' },
|
|
1037
|
+
f1: true,
|
|
1038
|
+
icon: breakpointsActivate,
|
|
1039
|
+
menu: {
|
|
1040
|
+
id: MenuId.ViewTitle,
|
|
1041
|
+
group: 'navigation',
|
|
1042
|
+
order: 20,
|
|
1043
|
+
when: ( ContextKeyExpr.equals('view', BREAKPOINTS_VIEW_ID))
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
run(accessor) {
|
|
1048
|
+
const debugService = accessor.get(IDebugService);
|
|
1049
|
+
debugService.setBreakpointsActivated(!debugService.getModel().areBreakpointsActivated());
|
|
1050
|
+
}
|
|
1051
|
+
});
|
|
1052
|
+
registerAction2(class extends Action2 {
|
|
1053
|
+
constructor() {
|
|
1054
|
+
super({
|
|
1055
|
+
id: 'workbench.debug.viewlet.action.removeBreakpoint',
|
|
1056
|
+
title: ( localize('removeBreakpoint', "Remove Breakpoint")),
|
|
1057
|
+
icon: Codicon.removeClose,
|
|
1058
|
+
menu: [{
|
|
1059
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1060
|
+
group: '3_modification',
|
|
1061
|
+
order: 10,
|
|
1062
|
+
when: ( CONTEXT_BREAKPOINT_ITEM_TYPE.notEqualsTo('exceptionBreakpoint'))
|
|
1063
|
+
}, {
|
|
1064
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1065
|
+
group: 'inline',
|
|
1066
|
+
order: 20,
|
|
1067
|
+
when: ( CONTEXT_BREAKPOINT_ITEM_TYPE.notEqualsTo('exceptionBreakpoint'))
|
|
1068
|
+
}]
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
async run(accessor, breakpoint) {
|
|
1072
|
+
const debugService = accessor.get(IDebugService);
|
|
1073
|
+
if (breakpoint instanceof Breakpoint) {
|
|
1074
|
+
await debugService.removeBreakpoints(breakpoint.getId());
|
|
1075
|
+
}
|
|
1076
|
+
else if (breakpoint instanceof FunctionBreakpoint) {
|
|
1077
|
+
await debugService.removeFunctionBreakpoints(breakpoint.getId());
|
|
1078
|
+
}
|
|
1079
|
+
else if (breakpoint instanceof DataBreakpoint) {
|
|
1080
|
+
await debugService.removeDataBreakpoints(breakpoint.getId());
|
|
1081
|
+
}
|
|
1082
|
+
else if (breakpoint instanceof InstructionBreakpoint) {
|
|
1083
|
+
await debugService.removeInstructionBreakpoints(breakpoint.instructionReference);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
registerAction2(class extends Action2 {
|
|
1088
|
+
constructor() {
|
|
1089
|
+
super({
|
|
1090
|
+
id: 'workbench.debug.viewlet.action.removeAllBreakpoints',
|
|
1091
|
+
title: {
|
|
1092
|
+
original: 'Remove All Breakpoints',
|
|
1093
|
+
value: ( localize('removeAllBreakpoints', "Remove All Breakpoints")),
|
|
1094
|
+
mnemonicTitle: ( localize(
|
|
1095
|
+
{ key: 'miRemoveAllBreakpoints', comment: ['&& denotes a mnemonic'] },
|
|
1096
|
+
"Remove &&All Breakpoints"
|
|
1097
|
+
))
|
|
1098
|
+
},
|
|
1099
|
+
f1: true,
|
|
1100
|
+
icon: breakpointsRemoveAll,
|
|
1101
|
+
menu: [{
|
|
1102
|
+
id: MenuId.ViewTitle,
|
|
1103
|
+
group: 'navigation',
|
|
1104
|
+
order: 30,
|
|
1105
|
+
when: ( ContextKeyExpr.equals('view', BREAKPOINTS_VIEW_ID))
|
|
1106
|
+
}, {
|
|
1107
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1108
|
+
group: '3_modification',
|
|
1109
|
+
order: 20,
|
|
1110
|
+
when: ( ContextKeyExpr.and(CONTEXT_BREAKPOINTS_EXIST, ( CONTEXT_BREAKPOINT_ITEM_TYPE.notEqualsTo('exceptionBreakpoint'))))
|
|
1111
|
+
}, {
|
|
1112
|
+
id: MenuId.MenubarDebugMenu,
|
|
1113
|
+
group: '5_breakpoints',
|
|
1114
|
+
order: 3,
|
|
1115
|
+
when: CONTEXT_DEBUGGERS_AVAILABLE
|
|
1116
|
+
}]
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
run(accessor) {
|
|
1120
|
+
const debugService = accessor.get(IDebugService);
|
|
1121
|
+
debugService.removeBreakpoints();
|
|
1122
|
+
debugService.removeFunctionBreakpoints();
|
|
1123
|
+
debugService.removeDataBreakpoints();
|
|
1124
|
+
debugService.removeInstructionBreakpoints();
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
registerAction2(class extends Action2 {
|
|
1128
|
+
constructor() {
|
|
1129
|
+
super({
|
|
1130
|
+
id: 'workbench.debug.viewlet.action.enableAllBreakpoints',
|
|
1131
|
+
title: {
|
|
1132
|
+
original: 'Enable All Breakpoints',
|
|
1133
|
+
value: ( localize('enableAllBreakpoints', "Enable All Breakpoints")),
|
|
1134
|
+
mnemonicTitle: ( localize(
|
|
1135
|
+
{ key: 'miEnableAllBreakpoints', comment: ['&& denotes a mnemonic'] },
|
|
1136
|
+
"&&Enable All Breakpoints"
|
|
1137
|
+
)),
|
|
1138
|
+
},
|
|
1139
|
+
f1: true,
|
|
1140
|
+
precondition: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
1141
|
+
menu: [{
|
|
1142
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1143
|
+
group: 'z_commands',
|
|
1144
|
+
order: 10,
|
|
1145
|
+
when: ( ContextKeyExpr.and(CONTEXT_BREAKPOINTS_EXIST, ( CONTEXT_BREAKPOINT_ITEM_TYPE.notEqualsTo('exceptionBreakpoint'))))
|
|
1146
|
+
}, {
|
|
1147
|
+
id: MenuId.MenubarDebugMenu,
|
|
1148
|
+
group: '5_breakpoints',
|
|
1149
|
+
order: 1,
|
|
1150
|
+
when: CONTEXT_DEBUGGERS_AVAILABLE
|
|
1151
|
+
}]
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
async run(accessor) {
|
|
1155
|
+
const debugService = accessor.get(IDebugService);
|
|
1156
|
+
await debugService.enableOrDisableBreakpoints(true);
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
1159
|
+
registerAction2(class extends Action2 {
|
|
1160
|
+
constructor() {
|
|
1161
|
+
super({
|
|
1162
|
+
id: 'workbench.debug.viewlet.action.disableAllBreakpoints',
|
|
1163
|
+
title: {
|
|
1164
|
+
original: 'Disable All Breakpoints',
|
|
1165
|
+
value: ( localize('disableAllBreakpoints', "Disable All Breakpoints")),
|
|
1166
|
+
mnemonicTitle: ( localize(
|
|
1167
|
+
{ key: 'miDisableAllBreakpoints', comment: ['&& denotes a mnemonic'] },
|
|
1168
|
+
"Disable A&&ll Breakpoints"
|
|
1169
|
+
))
|
|
1170
|
+
},
|
|
1171
|
+
f1: true,
|
|
1172
|
+
precondition: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
1173
|
+
menu: [{
|
|
1174
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1175
|
+
group: 'z_commands',
|
|
1176
|
+
order: 20,
|
|
1177
|
+
when: ( ContextKeyExpr.and(CONTEXT_BREAKPOINTS_EXIST, ( CONTEXT_BREAKPOINT_ITEM_TYPE.notEqualsTo('exceptionBreakpoint'))))
|
|
1178
|
+
}, {
|
|
1179
|
+
id: MenuId.MenubarDebugMenu,
|
|
1180
|
+
group: '5_breakpoints',
|
|
1181
|
+
order: 2,
|
|
1182
|
+
when: CONTEXT_DEBUGGERS_AVAILABLE
|
|
1183
|
+
}]
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
async run(accessor) {
|
|
1187
|
+
const debugService = accessor.get(IDebugService);
|
|
1188
|
+
await debugService.enableOrDisableBreakpoints(false);
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
registerAction2(class extends Action2 {
|
|
1192
|
+
constructor() {
|
|
1193
|
+
super({
|
|
1194
|
+
id: 'workbench.debug.viewlet.action.reapplyBreakpointsAction',
|
|
1195
|
+
title: { value: ( localize('reapplyAllBreakpoints', "Reapply All Breakpoints")), original: 'Reapply All Breakpoints' },
|
|
1196
|
+
f1: true,
|
|
1197
|
+
precondition: CONTEXT_IN_DEBUG_MODE,
|
|
1198
|
+
menu: [{
|
|
1199
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1200
|
+
group: 'z_commands',
|
|
1201
|
+
order: 30,
|
|
1202
|
+
when: ( ContextKeyExpr.and(CONTEXT_BREAKPOINTS_EXIST, ( CONTEXT_BREAKPOINT_ITEM_TYPE.notEqualsTo('exceptionBreakpoint'))))
|
|
1203
|
+
}]
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
async run(accessor) {
|
|
1207
|
+
const debugService = accessor.get(IDebugService);
|
|
1208
|
+
await debugService.setBreakpointsActivated(true);
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
registerAction2(class extends ViewAction {
|
|
1212
|
+
constructor() {
|
|
1213
|
+
super({
|
|
1214
|
+
id: 'debug.editBreakpoint',
|
|
1215
|
+
viewId: BREAKPOINTS_VIEW_ID,
|
|
1216
|
+
title: ( localize('editCondition', "Edit Condition...")),
|
|
1217
|
+
icon: Codicon.edit,
|
|
1218
|
+
precondition: CONTEXT_BREAKPOINT_SUPPORTS_CONDITION,
|
|
1219
|
+
menu: [{
|
|
1220
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1221
|
+
group: 'navigation',
|
|
1222
|
+
order: 10
|
|
1223
|
+
}, {
|
|
1224
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1225
|
+
group: 'inline',
|
|
1226
|
+
order: 10
|
|
1227
|
+
}]
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
async runInView(accessor, view, breakpoint) {
|
|
1231
|
+
const debugService = accessor.get(IDebugService);
|
|
1232
|
+
const editorService = accessor.get(IEditorService);
|
|
1233
|
+
if (breakpoint instanceof Breakpoint) {
|
|
1234
|
+
const editor = await openBreakpointSource(breakpoint, false, false, true, debugService, editorService);
|
|
1235
|
+
if (editor) {
|
|
1236
|
+
const codeEditor = editor.getControl();
|
|
1237
|
+
if (isCodeEditor(codeEditor)) {
|
|
1238
|
+
codeEditor.getContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID)?.showBreakpointWidget(breakpoint.lineNumber, breakpoint.column);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
else if (breakpoint instanceof FunctionBreakpoint) {
|
|
1243
|
+
const contextMenuService = accessor.get(IContextMenuService);
|
|
1244
|
+
const actions = [( new Action('breakpoint.editCondition', ( localize('editCondition', "Edit Condition...")), undefined, true, async () => view.renderInputBox({ breakpoint, type: 'condition' }))),
|
|
1245
|
+
( new Action('breakpoint.editCondition', ( localize('editHitCount', "Edit Hit Count...")), undefined, true, async () => view.renderInputBox({ breakpoint, type: 'hitCount' })))];
|
|
1246
|
+
const domNode = breakpointIdToActionBarDomeNode.get(breakpoint.getId());
|
|
1247
|
+
if (domNode) {
|
|
1248
|
+
contextMenuService.showContextMenu({
|
|
1249
|
+
getActions: () => actions,
|
|
1250
|
+
getAnchor: () => domNode,
|
|
1251
|
+
onHide: () => dispose(actions)
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
else {
|
|
1256
|
+
view.renderInputBox({ breakpoint, type: 'condition' });
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
});
|
|
1260
|
+
registerAction2(class extends ViewAction {
|
|
1261
|
+
constructor() {
|
|
1262
|
+
super({
|
|
1263
|
+
id: 'debug.editFunctionBreakpoint',
|
|
1264
|
+
viewId: BREAKPOINTS_VIEW_ID,
|
|
1265
|
+
title: ( localize('editBreakpoint', "Edit Function Breakpoint...")),
|
|
1266
|
+
menu: [{
|
|
1267
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1268
|
+
group: '1_breakpoints',
|
|
1269
|
+
order: 10,
|
|
1270
|
+
when: ( CONTEXT_BREAKPOINT_ITEM_TYPE.isEqualTo('functionBreakpoint'))
|
|
1271
|
+
}]
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
runInView(_accessor, view, breakpoint) {
|
|
1275
|
+
view.renderInputBox({ breakpoint, type: 'name' });
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
registerAction2(class extends ViewAction {
|
|
1279
|
+
constructor() {
|
|
1280
|
+
super({
|
|
1281
|
+
id: 'debug.editFunctionBreakpointHitCount',
|
|
1282
|
+
viewId: BREAKPOINTS_VIEW_ID,
|
|
1283
|
+
title: ( localize('editHitCount', "Edit Hit Count...")),
|
|
1284
|
+
precondition: CONTEXT_BREAKPOINT_SUPPORTS_CONDITION,
|
|
1285
|
+
menu: [{
|
|
1286
|
+
id: MenuId.DebugBreakpointsContext,
|
|
1287
|
+
group: 'navigation',
|
|
1288
|
+
order: 20,
|
|
1289
|
+
when: ( CONTEXT_BREAKPOINT_ITEM_TYPE.isEqualTo('functionBreakpoint'))
|
|
1290
|
+
}]
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
runInView(_accessor, view, breakpoint) {
|
|
1294
|
+
view.renderInputBox({ breakpoint, type: 'hitCount' });
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
|
|
1298
|
+
export { BreakpointsView, getBreakpointMessageAndIcon, getExpandedBodySize, openBreakpointSource };
|