@codingame/monaco-vscode-debug-service-override 1.82.6 → 1.83.0-next.0
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/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +4 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +2 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +16 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +1 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +16 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +40 -18
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +25 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +7 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +7 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +13 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +226 -118
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +26 -9
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +1 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +1 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +29 -12
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +8 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-debug-service-override",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.83.0-next.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.
|
|
22
|
-
"monaco-editor": "0.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.83.0-next.0",
|
|
22
|
+
"monaco-editor": "0.44.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -6,7 +6,7 @@ import { InputBox } from 'monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox
|
|
|
6
6
|
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
7
7
|
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
8
8
|
import { createMatches } from 'monaco-editor/esm/vs/base/common/filters.js';
|
|
9
|
-
import {
|
|
9
|
+
import { createSingleCallFunction } from 'monaco-editor/esm/vs/base/common/functional.js';
|
|
10
10
|
import { DisposableStore, dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
11
11
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
12
12
|
import { IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
@@ -149,7 +149,7 @@ let AbstractExpressionsRenderer = class AbstractExpressionsRenderer {
|
|
|
149
149
|
inputBox.value = options.initialValue;
|
|
150
150
|
inputBox.focus();
|
|
151
151
|
inputBox.select();
|
|
152
|
-
const done =
|
|
152
|
+
const done = createSingleCallFunction((success, finishEditing) => {
|
|
153
153
|
nameElement.style.display = '';
|
|
154
154
|
valueElement.style.display = '';
|
|
155
155
|
inputBoxContainer.style.display = 'none';
|
|
@@ -681,14 +681,14 @@ class InlineBreakpointWidget {
|
|
|
681
681
|
});
|
|
682
682
|
}));
|
|
683
683
|
const updateSize = () => {
|
|
684
|
-
const lineHeight = this.editor.getOption(
|
|
684
|
+
const lineHeight = this.editor.getOption(66 );
|
|
685
685
|
this.domNode.style.height = `${lineHeight}px`;
|
|
686
686
|
this.domNode.style.width = `${Math.ceil(0.8 * lineHeight)}px`;
|
|
687
687
|
this.domNode.style.marginLeft = `4px`;
|
|
688
688
|
};
|
|
689
689
|
updateSize();
|
|
690
690
|
this.toDispose.push(this.editor.onDidChangeConfiguration(c => {
|
|
691
|
-
if (c.hasChanged(
|
|
691
|
+
if (c.hasChanged(52 ) || c.hasChanged(66 )) {
|
|
692
692
|
updateSize();
|
|
693
693
|
}
|
|
694
694
|
}));
|
|
@@ -289,7 +289,7 @@ let BreakpointWidget = class BreakpointWidget extends ZoneWidget {
|
|
|
289
289
|
}
|
|
290
290
|
centerInputVertically() {
|
|
291
291
|
if (this.container && typeof this.heightInPx === 'number') {
|
|
292
|
-
const lineHeight = this.input.getOption(
|
|
292
|
+
const lineHeight = this.input.getOption(66 );
|
|
293
293
|
const lineNum = this.input.getModel().getLineCount();
|
|
294
294
|
const newTopMargin = (this.heightInPx - lineNum * lineHeight) / 2;
|
|
295
295
|
this.inputContainer.style.marginTop = newTopMargin + 'px';
|
|
@@ -114,7 +114,7 @@ let BreakpointsView = class BreakpointsView extends ViewPane {
|
|
|
114
114
|
await this.debugService.removeDataBreakpoints(element.getId());
|
|
115
115
|
}
|
|
116
116
|
else if (element instanceof InstructionBreakpoint) {
|
|
117
|
-
await this.debugService.removeInstructionBreakpoints(element.instructionReference);
|
|
117
|
+
await this.debugService.removeInstructionBreakpoints(element.instructionReference, element.offset);
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
this._register(this.list.onDidOpen(async (e) => {
|
|
@@ -129,7 +129,7 @@ let BreakpointsView = class BreakpointsView extends ViewPane {
|
|
|
129
129
|
}
|
|
130
130
|
if (e.element instanceof InstructionBreakpoint) {
|
|
131
131
|
const disassemblyView = await this.editorService.openEditor(DisassemblyViewInput.instance);
|
|
132
|
-
disassemblyView.
|
|
132
|
+
disassemblyView.goToInstructionAndOffset(e.element.instructionReference, e.element.offset, e.browserEvent instanceof MouseEvent && e.browserEvent.detail === 2);
|
|
133
133
|
}
|
|
134
134
|
if (e.browserEvent instanceof MouseEvent && e.browserEvent.detail === 2 && e.element instanceof FunctionBreakpoint && e.element !== this.inputBoxData?.breakpoint) {
|
|
135
135
|
this.renderInputBox({ breakpoint: e.element, type: 'name' });
|
|
@@ -628,7 +628,8 @@ let InstructionBreakpointsRenderer = class InstructionBreakpointsRenderer {
|
|
|
628
628
|
renderElement(breakpoint, index, data) {
|
|
629
629
|
data.context = breakpoint;
|
|
630
630
|
data.breakpoint.classList.toggle('disabled', !this.debugService.getModel().areBreakpointsActivated());
|
|
631
|
-
data.name.textContent = breakpoint.
|
|
631
|
+
data.name.textContent = '0x' + ( breakpoint.address.toString(16));
|
|
632
|
+
data.name.title = `Decimal address: breakpoint.address.toString()`;
|
|
632
633
|
data.checkbox.checked = breakpoint.enabled;
|
|
633
634
|
const { message, icon } = getBreakpointMessageAndIcon(this.debugService.state, this.debugService.getModel().areBreakpointsActivated(), breakpoint, this.labelService);
|
|
634
635
|
data.icon.className = ThemeIcon.asClassName(icon);
|
|
@@ -226,6 +226,7 @@ let CallStackView = class CallStackView extends ViewPane {
|
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
this.tree.setInput(this.debugService.getModel());
|
|
229
|
+
this._register(this.tree);
|
|
229
230
|
this._register(this.tree.onDidOpen(async (e) => {
|
|
230
231
|
if (this.ignoreSelectionChangedEvent) {
|
|
231
232
|
return;
|
|
@@ -389,6 +390,7 @@ let CallStackView = class CallStackView extends ViewPane {
|
|
|
389
390
|
const contextKeyService = this.contextKeyService.createOverlay(overlay);
|
|
390
391
|
const menu = this.menuService.createMenu(MenuId.DebugCallStackContext, contextKeyService);
|
|
391
392
|
createAndFillInContextMenuActions(menu, { arg: getContextForContributedActions(element), shouldForwardArgs: true }, result, 'inline');
|
|
393
|
+
menu.dispose();
|
|
392
394
|
this.contextMenuService.showContextMenu({
|
|
393
395
|
getAnchor: () => e.anchor,
|
|
394
396
|
getActions: () => result.secondary,
|
|
@@ -176,10 +176,10 @@ MenuRegistry.appendMenuItem(MenuId.MenubarNewBreakpointMenu, {
|
|
|
176
176
|
});
|
|
177
177
|
const VIEW_CONTAINER = ( Registry.as(Extensions$2.ViewContainersRegistry)).registerViewContainer({
|
|
178
178
|
id: DEBUG_PANEL_ID,
|
|
179
|
-
title: ( nls.localize(
|
|
179
|
+
title: { value: ( nls.localize(
|
|
180
180
|
{ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' },
|
|
181
181
|
"Debug Console"
|
|
182
|
-
)),
|
|
182
|
+
)), original: 'Debug Console' },
|
|
183
183
|
icon: debugConsoleViewIcon,
|
|
184
184
|
ctorDescriptor: ( new SyncDescriptor(
|
|
185
185
|
ViewPaneContainer,
|
|
@@ -278,12 +278,23 @@ configurationRegistry.registerConfiguration({
|
|
|
278
278
|
default: 'auto'
|
|
279
279
|
},
|
|
280
280
|
'debug.toolBarLocation': {
|
|
281
|
-
enum: ['floating', 'docked', 'hidden'],
|
|
281
|
+
enum: ['floating', 'docked', 'commandCenter', 'hidden'],
|
|
282
282
|
markdownDescription: ( nls.localize(
|
|
283
283
|
{ comment: ['This is the description for a setting'], key: 'toolBarLocation' },
|
|
284
|
-
"Controls the location of the debug toolbar. Either `floating` in all views, `docked` in the debug view, or `hidden`."
|
|
284
|
+
"Controls the location of the debug toolbar. Either `floating` in all views, `docked` in the debug view, `commandCenter` (requires `{0}`), or `hidden`.",
|
|
285
|
+
'#window.commandCenter#',
|
|
286
|
+
'#window.titleBarStyle#'
|
|
285
287
|
)),
|
|
286
|
-
default: 'floating'
|
|
288
|
+
default: 'floating',
|
|
289
|
+
markdownEnumDescriptions: [
|
|
290
|
+
( nls.localize('debugToolBar.floating', "Show debug toolbar in all views.")),
|
|
291
|
+
( nls.localize('debugToolBar.docked', "Show debug toolbar only in debug views.")),
|
|
292
|
+
( nls.localize(
|
|
293
|
+
'debugToolBar.commandCenter',
|
|
294
|
+
"`(Experimental)` Show debug toolbar in the command center."
|
|
295
|
+
)),
|
|
296
|
+
( nls.localize('debugToolBar.hidden', "Do not show debug toolbar.")),
|
|
297
|
+
]
|
|
287
298
|
},
|
|
288
299
|
'debug.showInStatusBar': {
|
|
289
300
|
enum: ['never', 'always', 'onFirstSessionStart'],
|
|
@@ -324,6 +324,7 @@ let AdapterManager = class AdapterManager extends Disposable {
|
|
|
324
324
|
}
|
|
325
325
|
this.initExtensionActivationsIfNeeded();
|
|
326
326
|
candidates.sort((first, second) => first.label.localeCompare(second.label));
|
|
327
|
+
candidates = candidates.filter(a => !a.isHiddenFromDropdown);
|
|
327
328
|
const suggestedCandidates = [];
|
|
328
329
|
const otherCandidates = [];
|
|
329
330
|
candidates.forEach(d => {
|
|
@@ -611,8 +611,23 @@ CommandsRegistry.registerCommand({
|
|
|
611
611
|
});
|
|
612
612
|
CommandsRegistry.registerCommand({
|
|
613
613
|
id: SELECT_AND_START_ID,
|
|
614
|
-
handler: async (accessor) => {
|
|
614
|
+
handler: async (accessor, debugType) => {
|
|
615
615
|
const quickInputService = accessor.get(IQuickInputService);
|
|
616
|
+
const debugService = accessor.get(IDebugService);
|
|
617
|
+
if (debugType) {
|
|
618
|
+
const configManager = debugService.getConfigurationManager();
|
|
619
|
+
const dynamicProviders = await configManager.getDynamicProviders();
|
|
620
|
+
for (const provider of dynamicProviders) {
|
|
621
|
+
if (provider.type === debugType) {
|
|
622
|
+
const pick = await provider.pick();
|
|
623
|
+
if (pick) {
|
|
624
|
+
await configManager.selectConfiguration(pick.launch, pick.config.name, pick.config, { type: provider.type });
|
|
625
|
+
debugService.startDebugging(pick.launch, pick.config, { startedByUser: true });
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
616
631
|
quickInputService.quickAccess.show(DEBUG_QUICK_ACCESS_PREFIX);
|
|
617
632
|
}
|
|
618
633
|
});
|
|
@@ -2,6 +2,7 @@ import { getDomNodePagePosition } from 'monaco-editor/esm/vs/base/browser/dom.js
|
|
|
2
2
|
import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
3
3
|
import { KeyChord } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
|
|
4
4
|
import { EditorAction2, EditorAction, registerEditorAction } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
5
|
+
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
5
6
|
import { Position } from 'monaco-editor/esm/vs/editor/common/core/position.js';
|
|
6
7
|
import { EditorContextKeys } from 'monaco-editor/esm/vs/editor/common/editorContextKeys.js';
|
|
7
8
|
import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
|
|
@@ -15,38 +16,59 @@ import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/c
|
|
|
15
16
|
import { PanelFocusContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
16
17
|
import { IViewsService } from 'vscode/vscode/vs/workbench/common/views';
|
|
17
18
|
import { openBreakpointSource } from './breakpointsView.js';
|
|
18
|
-
import {
|
|
19
|
+
import { DisassemblyView } from './disassemblyView.js';
|
|
20
|
+
import { CONTEXT_FOCUSED_STACK_FRAME_HAS_INSTRUCTION_POINTER_REFERENCE, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE, CONTEXT_DISASSEMBLE_REQUEST_SUPPORTED, CONTEXT_LANGUAGE_SUPPORTS_DISASSEMBLE_REQUEST, CONTEXT_CALLSTACK_ITEM_TYPE, CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DISASSEMBLY_VIEW_FOCUS, IDebugService, REPL_VIEW_ID, WATCH_VIEW_ID, CONTEXT_STEP_INTO_TARGETS_SUPPORTED, BREAKPOINT_EDITOR_CONTRIBUTION_ID, EDITOR_CONTRIBUTION_ID, CONTEXT_EXCEPTION_WIDGET_VISIBLE } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
19
21
|
import { getEvaluatableExpressionAtPosition } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
|
|
20
22
|
import { DisassemblyViewInput } from '../common/disassemblyViewInput.js';
|
|
21
23
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
22
24
|
|
|
23
|
-
class ToggleBreakpointAction extends
|
|
25
|
+
class ToggleBreakpointAction extends Action2 {
|
|
24
26
|
constructor() {
|
|
25
27
|
super({
|
|
26
28
|
id: 'editor.debug.action.toggleBreakpoint',
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
title: {
|
|
30
|
+
value: ( nls.localize('toggleBreakpointAction', "Debug: Toggle Breakpoint")),
|
|
31
|
+
original: 'Debug: Toggle Breakpoint',
|
|
32
|
+
mnemonicTitle: ( nls.localize(
|
|
33
|
+
{ key: 'miToggleBreakpoint', comment: ['&& denotes a mnemonic'] },
|
|
34
|
+
"Toggle &&Breakpoint"
|
|
35
|
+
)),
|
|
36
|
+
},
|
|
29
37
|
precondition: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
keybinding: {
|
|
39
|
+
when: ( ContextKeyExpr.or(EditorContextKeys.editorTextFocus, CONTEXT_DISASSEMBLY_VIEW_FOCUS)),
|
|
32
40
|
primary: 67 ,
|
|
33
41
|
weight: 100
|
|
34
42
|
},
|
|
35
|
-
|
|
43
|
+
menu: {
|
|
44
|
+
id: MenuId.MenubarDebugMenu,
|
|
36
45
|
when: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
37
|
-
title: ( nls.localize(
|
|
38
|
-
{ key: 'miToggleBreakpoint', comment: ['&& denotes a mnemonic'] },
|
|
39
|
-
"Toggle &&Breakpoint"
|
|
40
|
-
)),
|
|
41
|
-
menuId: MenuId.MenubarDebugMenu,
|
|
42
46
|
group: '4_new_breakpoint',
|
|
43
47
|
order: 1
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
50
|
}
|
|
47
|
-
async run(accessor
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
async run(accessor) {
|
|
52
|
+
const editorService = accessor.get(IEditorService);
|
|
53
|
+
const debugService = accessor.get(IDebugService);
|
|
54
|
+
const activePane = editorService.activeEditorPane;
|
|
55
|
+
if (activePane instanceof DisassemblyView) {
|
|
56
|
+
const location = activePane.focusedAddressAndOffset;
|
|
57
|
+
if (location) {
|
|
58
|
+
const bps = debugService.getModel().getInstructionBreakpoints();
|
|
59
|
+
const toRemove = bps.find(bp => bp.address === location.address);
|
|
60
|
+
if (toRemove) {
|
|
61
|
+
debugService.removeInstructionBreakpoints(toRemove.instructionReference, toRemove.offset);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
debugService.addInstructionBreakpoint(location.reference, location.offset, location.address);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const codeEditorService = accessor.get(ICodeEditorService);
|
|
70
|
+
const editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();
|
|
71
|
+
if (editor?.hasModel()) {
|
|
50
72
|
const modelUri = editor.getModel().uri;
|
|
51
73
|
const canSet = debugService.canSetBreakpointsIn(editor.getModel());
|
|
52
74
|
const lineNumbers = [...( new Set(( editor.getSelections().map(s => s.getPosition().lineNumber))))];
|
|
@@ -196,7 +218,7 @@ class OpenDisassemblyViewAction extends EditorAction2 {
|
|
|
196
218
|
runEditorCommand(accessor, editor, ...args) {
|
|
197
219
|
if (editor.hasModel()) {
|
|
198
220
|
const editorService = accessor.get(IEditorService);
|
|
199
|
-
editorService.openEditor(DisassemblyViewInput.instance, { pinned: true });
|
|
221
|
+
editorService.openEditor(DisassemblyViewInput.instance, { pinned: true, revealIfOpened: true });
|
|
200
222
|
}
|
|
201
223
|
}
|
|
202
224
|
}
|
|
@@ -236,7 +258,7 @@ class RunToCursorAction extends EditorAction {
|
|
|
236
258
|
id: RunToCursorAction.ID,
|
|
237
259
|
label: RunToCursorAction.LABEL,
|
|
238
260
|
alias: 'Debug: Run to Cursor',
|
|
239
|
-
precondition: ( ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, ( PanelFocusContext.toNegated()), EditorContextKeys.editorTextFocus)),
|
|
261
|
+
precondition: ( ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, ( PanelFocusContext.toNegated()), ( ContextKeyExpr.or(EditorContextKeys.editorTextFocus, CONTEXT_DISASSEMBLY_VIEW_FOCUS)))),
|
|
240
262
|
contextMenuOpts: {
|
|
241
263
|
group: 'debug',
|
|
242
264
|
order: 2,
|
|
@@ -511,7 +533,7 @@ class CloseExceptionWidgetAction extends EditorAction {
|
|
|
511
533
|
}
|
|
512
534
|
registerAction2(OpenDisassemblyViewAction);
|
|
513
535
|
registerAction2(ToggleDisassemblyViewSourceCodeAction);
|
|
514
|
-
|
|
536
|
+
registerAction2(ToggleBreakpointAction);
|
|
515
537
|
registerEditorAction(ConditionalBreakpointAction);
|
|
516
538
|
registerEditorAction(LogPointAction);
|
|
517
539
|
registerEditorAction(EditBreakpointAction);
|
|
@@ -4,9 +4,9 @@ import { DomEmitter } from 'monaco-editor/esm/vs/base/browser/event.js';
|
|
|
4
4
|
import { StandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboardEvent.js';
|
|
5
5
|
import { flatten, distinct } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
6
6
|
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
7
|
-
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
7
|
+
import { CancellationToken, CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
8
8
|
import { memoize } from 'monaco-editor/esm/vs/base/common/decorators.js';
|
|
9
|
-
import { onUnexpectedExternalError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
9
|
+
import { illegalArgument, onUnexpectedExternalError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
10
10
|
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
11
11
|
import { visit } from 'monaco-editor/esm/vs/base/common/json.js';
|
|
12
12
|
import { setProperty } from 'vscode/vscode/vs/base/common/jsonEdit';
|
|
@@ -14,6 +14,8 @@ import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
|
14
14
|
import { basename } from 'monaco-editor/esm/vs/base/common/path.js';
|
|
15
15
|
import * as platform from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
16
16
|
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
17
|
+
import { assertType, isDefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
18
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
17
19
|
import { CoreEditingCommands } from 'monaco-editor/esm/vs/editor/browser/coreCommands.js';
|
|
18
20
|
import { EditOperation } from 'monaco-editor/esm/vs/editor/common/core/editOperation.js';
|
|
19
21
|
import { Position } from 'monaco-editor/esm/vs/editor/common/core/position.js';
|
|
@@ -22,9 +24,10 @@ import { DEFAULT_WORD_REGEXP } from 'monaco-editor/esm/vs/editor/common/core/wor
|
|
|
22
24
|
import { InjectedTextCursorStops } from 'monaco-editor/esm/vs/editor/common/model.js';
|
|
23
25
|
import { ILanguageFeatureDebounceService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatureDebounce.js';
|
|
24
26
|
import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
|
|
27
|
+
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
25
28
|
import { ModesHoverController } from 'monaco-editor/esm/vs/editor/contrib/hover/browser/hover.js';
|
|
26
29
|
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
27
|
-
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
30
|
+
import { CommandsRegistry, ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
28
31
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
29
32
|
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
30
33
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
@@ -336,7 +339,7 @@ let DebugEditorContribution = class DebugEditorContribution {
|
|
|
336
339
|
await this.updateInlineValueDecorations(sf);
|
|
337
340
|
}
|
|
338
341
|
get showHoverScheduler() {
|
|
339
|
-
const hoverOption = this.editor.getOption(
|
|
342
|
+
const hoverOption = this.editor.getOption(60 );
|
|
340
343
|
const scheduler = ( new RunOnceScheduler(() => {
|
|
341
344
|
if (this.hoverPosition && !this.altPressed) {
|
|
342
345
|
this.showHover(this.hoverPosition, false);
|
|
@@ -677,5 +680,23 @@ DebugEditorContribution = ( __decorate([
|
|
|
677
680
|
( __param(8, ILanguageFeaturesService)),
|
|
678
681
|
( __param(9, ILanguageFeatureDebounceService))
|
|
679
682
|
], DebugEditorContribution));
|
|
683
|
+
CommandsRegistry.registerCommand('_executeInlineValueProvider', async (accessor, uri, iRange, context) => {
|
|
684
|
+
assertType(URI.isUri(uri));
|
|
685
|
+
assertType(Range.isIRange(iRange));
|
|
686
|
+
if (!context || typeof context.frameId !== 'number' || !Range.isIRange(context.stoppedLocation)) {
|
|
687
|
+
throw illegalArgument('context');
|
|
688
|
+
}
|
|
689
|
+
const model = accessor.get(IModelService).getModel(uri);
|
|
690
|
+
if (!model) {
|
|
691
|
+
throw illegalArgument('uri');
|
|
692
|
+
}
|
|
693
|
+
const range = Range.lift(iRange);
|
|
694
|
+
const { inlineValuesProvider } = accessor.get(ILanguageFeaturesService);
|
|
695
|
+
const providers = inlineValuesProvider.ordered(model);
|
|
696
|
+
const providerResults = await Promise.all(( providers.map(
|
|
697
|
+
provider => provider.provideInlineValues(model, range, context, CancellationToken.None)
|
|
698
|
+
)));
|
|
699
|
+
return providerResults.flat().filter(isDefined);
|
|
700
|
+
});
|
|
680
701
|
|
|
681
702
|
export { DebugEditorContribution };
|
|
@@ -910,14 +910,14 @@ let DebugService = class DebugService {
|
|
|
910
910
|
this.debugStorage.storeBreakpoints(this.model);
|
|
911
911
|
await this.sendDataBreakpoints();
|
|
912
912
|
}
|
|
913
|
-
async addInstructionBreakpoint(
|
|
914
|
-
this.model.addInstructionBreakpoint(
|
|
913
|
+
async addInstructionBreakpoint(instructionReference, offset, address, condition, hitCondition) {
|
|
914
|
+
this.model.addInstructionBreakpoint(instructionReference, offset, address, condition, hitCondition);
|
|
915
915
|
this.debugStorage.storeBreakpoints(this.model);
|
|
916
916
|
await this.sendInstructionBreakpoints();
|
|
917
917
|
this.debugStorage.storeBreakpoints(this.model);
|
|
918
918
|
}
|
|
919
|
-
async removeInstructionBreakpoints(
|
|
920
|
-
this.model.removeInstructionBreakpoints(
|
|
919
|
+
async removeInstructionBreakpoints(instructionReference, offset) {
|
|
920
|
+
this.model.removeInstructionBreakpoints(instructionReference, offset);
|
|
921
921
|
this.debugStorage.storeBreakpoints(this.model);
|
|
922
922
|
await this.sendInstructionBreakpoints();
|
|
923
923
|
}
|
|
@@ -6,7 +6,7 @@ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancel
|
|
|
6
6
|
import { canceled } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
7
7
|
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
8
8
|
import { normalizeDriveLetter } from 'monaco-editor/esm/vs/base/common/labels.js';
|
|
9
|
-
import { DisposableStore, MutableDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
9
|
+
import { DisposableStore, MutableDisposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
10
10
|
import { mixin } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
11
11
|
import * as platform from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
12
12
|
import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
@@ -76,11 +76,14 @@ let DebugSession = class DebugSession {
|
|
|
76
76
|
else {
|
|
77
77
|
this.repl = this.parentSession.repl;
|
|
78
78
|
}
|
|
79
|
-
const toDispose =
|
|
79
|
+
const toDispose = ( new DisposableStore());
|
|
80
80
|
const replListener = toDispose.add(( new MutableDisposable()));
|
|
81
81
|
replListener.value = this.repl.onDidChangeElements(() => this._onDidChangeREPLElements.fire());
|
|
82
82
|
if (lifecycleService) {
|
|
83
|
-
toDispose.add(lifecycleService.onWillShutdown(() =>
|
|
83
|
+
toDispose.add(lifecycleService.onWillShutdown(() => {
|
|
84
|
+
this.shutdown();
|
|
85
|
+
dispose(toDispose);
|
|
86
|
+
}));
|
|
84
87
|
}
|
|
85
88
|
const compoundRoot = this._options.compoundRoot;
|
|
86
89
|
if (compoundRoot) {
|
|
@@ -420,7 +423,7 @@ let DebugSession = class DebugSession {
|
|
|
420
423
|
throw new Error(localize('noDebugAdapter', "No debugger available, can not send '{0}'", 'instruction breakpoints'));
|
|
421
424
|
}
|
|
422
425
|
if (this.raw.readyForBreakpoints) {
|
|
423
|
-
const response = await this.raw.setInstructionBreakpoints({ breakpoints: instructionBreakpoints });
|
|
426
|
+
const response = await this.raw.setInstructionBreakpoints({ breakpoints: ( instructionBreakpoints.map(ib => ib.toJSON())) });
|
|
424
427
|
if (response && response.body) {
|
|
425
428
|
const data = ( new Map());
|
|
426
429
|
for (let i = 0; i < instructionBreakpoints.length; i++) {
|
|
@@ -204,24 +204,25 @@ let DebugTaskRunner = class DebugTaskRunner {
|
|
|
204
204
|
))]));
|
|
205
205
|
}
|
|
206
206
|
let taskStarted = false;
|
|
207
|
-
const
|
|
207
|
+
const taskKey = task.getMapKey();
|
|
208
|
+
const inactivePromise = ( new Promise((c) => once(e => {
|
|
208
209
|
return (e.kind === "inactive"
|
|
209
210
|
|| (e.kind === "processEnded" && e.exitCode === undefined))
|
|
210
|
-
&& e.
|
|
211
|
+
&& e.__task?.getMapKey() === taskKey;
|
|
211
212
|
}, this.taskService.onDidStateChange)(e => {
|
|
212
213
|
taskStarted = true;
|
|
213
214
|
c(e.kind === "processEnded" ? { exitCode: e.exitCode } : null);
|
|
214
215
|
})));
|
|
215
216
|
const promise = this.taskService.getActiveTasks().then(async (tasks) => {
|
|
216
|
-
if (tasks.find(t => t.
|
|
217
|
+
if (tasks.find(t => t.getMapKey() === taskKey)) {
|
|
217
218
|
const busyTasks = await this.taskService.getBusyTasks();
|
|
218
|
-
if (busyTasks.find(t => t.
|
|
219
|
+
if (busyTasks.find(t => t.getMapKey() === taskKey)) {
|
|
219
220
|
taskStarted = true;
|
|
220
221
|
return inactivePromise;
|
|
221
222
|
}
|
|
222
223
|
return Promise.resolve(null);
|
|
223
224
|
}
|
|
224
|
-
once(e => (((e.kind === "active") ) || ((e.kind === "dependsOnStarted") )) && e.
|
|
225
|
+
once(e => (((e.kind === "active") ) || ((e.kind === "dependsOnStarted") )) && e.__task?.getMapKey() === taskKey, this.taskService.onDidStateChange)(() => {
|
|
225
226
|
taskStarted = true;
|
|
226
227
|
});
|
|
227
228
|
const taskPromise = this.taskService.run(task);
|
|
@@ -232,7 +233,7 @@ let DebugTaskRunner = class DebugTaskRunner {
|
|
|
232
233
|
});
|
|
233
234
|
return ( new Promise((c, e) => {
|
|
234
235
|
const waitForInput = ( new Promise(
|
|
235
|
-
resolve => once(e => ((e.kind === "acquiredInput") ) && e.
|
|
236
|
+
resolve => once(e => ((e.kind === "acquiredInput") ) && e.__task?.getMapKey() === taskKey, this.taskService.onDidStateChange)(() => {
|
|
236
237
|
resolve();
|
|
237
238
|
})
|
|
238
239
|
));
|
|
@@ -25,10 +25,11 @@ import { Themable, IThemeService } from 'monaco-editor/esm/vs/platform/theme/com
|
|
|
25
25
|
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
26
26
|
import { FocusSessionActionViewItem } from './debugActionViewItems.js';
|
|
27
27
|
import { debugToolBarBackground, debugToolBarBorder } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugColors';
|
|
28
|
-
import { CONTINUE_LABEL, CONTINUE_ID, PAUSE_LABEL, PAUSE_ID, DISCONNECT_ID, DISCONNECT_LABEL, STOP_LABEL, STOP_ID, STEP_OVER_LABEL, STEP_OVER_ID, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID, STEP_BACK_ID, REVERSE_CONTINUE_ID, DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL,
|
|
28
|
+
import { CONTINUE_LABEL, CONTINUE_ID, PAUSE_LABEL, PAUSE_ID, DISCONNECT_ID, DISCONNECT_LABEL, STOP_LABEL, STOP_ID, STEP_OVER_LABEL, STEP_OVER_ID, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID, STEP_BACK_ID, REVERSE_CONTINUE_ID, FOCUS_SESSION_LABEL, FOCUS_SESSION_ID, DISCONNECT_AND_SUSPEND_ID, DISCONNECT_AND_SUSPEND_LABEL, RESTART_LABEL, RESTART_SESSION_ID } from './debugCommands.js';
|
|
29
29
|
import { debugContinue, debugPause, debugDisconnect, debugStop, debugStepOver, debugStepInto, debugStepOut, debugStepBack, debugReverseContinue, debugGripper, debugRestart } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
|
|
30
|
-
import { VIEWLET_ID, CONTEXT_DEBUG_STATE, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED, CONTEXT_STEP_BACK_SUPPORTED,
|
|
30
|
+
import { VIEWLET_ID, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_MULTI_SESSION_DEBUG, CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
31
31
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
32
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
32
33
|
|
|
33
34
|
const DEBUG_TOOLBAR_POSITION_KEY = 'debug.actionswidgetposition';
|
|
34
35
|
const DEBUG_TOOLBAR_Y_KEY = 'debug.actionswidgety';
|
|
@@ -73,8 +74,7 @@ let DebugToolBar = class DebugToolBar extends Themable {
|
|
|
73
74
|
const state = this.debugService.state;
|
|
74
75
|
const toolBarLocation = this.configurationService.getValue('debug').toolBarLocation;
|
|
75
76
|
if (state === 0 ||
|
|
76
|
-
toolBarLocation
|
|
77
|
-
toolBarLocation === 'hidden' ||
|
|
77
|
+
toolBarLocation !== 'floating' ||
|
|
78
78
|
this.debugService.getModel().getSessions().every(s => s.suppressDebugToolbar) ||
|
|
79
79
|
(state === 1 && this.debugService.initializingOptions?.suppressDebugToolbar)) {
|
|
80
80
|
return this.hide();
|
|
@@ -269,6 +269,14 @@ MenuRegistry.onDidChangeMenu(e => {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
|
+
const CONTEXT_TOOLBAR_COMMAND_CENTER = ( ContextKeyExpr.equals('config.debug.toolBarLocation', 'commandCenter'));
|
|
273
|
+
MenuRegistry.appendMenuItem(MenuId.CommandCenterCenter, {
|
|
274
|
+
submenu: MenuId.DebugToolBar,
|
|
275
|
+
title: 'Debug',
|
|
276
|
+
icon: Codicon.debug,
|
|
277
|
+
order: 1,
|
|
278
|
+
when: ( ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_TOOLBAR_COMMAND_CENTER))
|
|
279
|
+
});
|
|
272
280
|
registerDebugToolBarItem(CONTINUE_ID, CONTINUE_LABEL, 10, debugContinue, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
|
|
273
281
|
registerDebugToolBarItem(PAUSE_ID, PAUSE_LABEL, 10, debugPause, ( CONTEXT_DEBUG_STATE.notEqualsTo('stopped')), ( CONTEXT_DEBUG_STATE.isEqualTo('running')));
|
|
274
282
|
registerDebugToolBarItem(STOP_ID, STOP_LABEL, 70, debugStop, ( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), undefined, { id: DISCONNECT_ID, title: DISCONNECT_LABEL, icon: debugDisconnect, precondition: ( ContextKeyExpr.and(( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)), });
|
|
@@ -279,7 +287,7 @@ registerDebugToolBarItem(STEP_OUT_ID, STEP_OUT_LABEL, 40, debugStepOut, undefine
|
|
|
279
287
|
registerDebugToolBarItem(RESTART_SESSION_ID, RESTART_LABEL, 60, debugRestart);
|
|
280
288
|
registerDebugToolBarItem(STEP_BACK_ID, ( localize('stepBackDebug', "Step Back")), 50, debugStepBack, CONTEXT_STEP_BACK_SUPPORTED, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
|
|
281
289
|
registerDebugToolBarItem(REVERSE_CONTINUE_ID, ( localize('reverseContinue', "Reverse")), 55, debugReverseContinue, CONTEXT_STEP_BACK_SUPPORTED, ( CONTEXT_DEBUG_STATE.isEqualTo('stopped')));
|
|
282
|
-
registerDebugToolBarItem(FOCUS_SESSION_ID, FOCUS_SESSION_LABEL, 100,
|
|
290
|
+
registerDebugToolBarItem(FOCUS_SESSION_ID, FOCUS_SESSION_LABEL, 100, Codicon.listTree, ( ContextKeyExpr.and(CONTEXT_MULTI_SESSION_DEBUG, ( CONTEXT_TOOLBAR_COMMAND_CENTER.negate()))));
|
|
283
291
|
MenuRegistry.appendMenuItem(MenuId.DebugToolBarStop, {
|
|
284
292
|
group: 'navigation',
|
|
285
293
|
when: ( ContextKeyExpr.and(( CONTEXT_FOCUSED_SESSION_IS_ATTACH.toNegated()), CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED)),
|