@codingame/monaco-vscode-debug-service-override 2.0.3 → 2.1.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/debug.js +3 -1
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +47 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +7 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +18 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +36 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +137 -121
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +34 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +106 -38
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +123 -56
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +8 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +43 -19
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +2 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +18 -8
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +87 -36
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +45 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +9 -3
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +0 -204
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +0 -287
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { PixelRatio } from 'vscode/vscode/vs/base/browser/browser';
|
|
3
|
-
import { $, append,
|
|
3
|
+
import { $, append, addDisposableGenericMouseUpListener, getWindow, addDisposableGenericMouseDownListener, addDisposableListener, EventType, show, hide } from 'vscode/vscode/vs/base/browser/dom';
|
|
4
4
|
import { StandardMouseEvent } from 'vscode/vscode/vs/base/browser/mouseEvent';
|
|
5
5
|
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
6
6
|
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
7
7
|
import { equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
8
8
|
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
9
9
|
import { isCancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
10
|
-
import { dispose, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
10
|
+
import { dispose, DisposableStore, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
11
|
import './media/debugToolBar.css.js';
|
|
12
12
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
13
13
|
import { DropdownWithPrimaryActionViewItem } from 'vscode/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem';
|
|
@@ -31,6 +31,7 @@ import { VIEWLET_ID, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, CONTEXT_FOCUSED
|
|
|
31
31
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
32
32
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
33
33
|
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
34
|
+
import { clamp } from 'vscode/vscode/vs/base/common/numbers';
|
|
34
35
|
|
|
35
36
|
const DEBUG_TOOLBAR_POSITION_KEY = 'debug.actionswidgetposition';
|
|
36
37
|
const DEBUG_TOOLBAR_Y_KEY = 'debug.actionswidgety';
|
|
@@ -48,6 +49,7 @@ let DebugToolBar = class DebugToolBar extends Themable {
|
|
|
48
49
|
this.isVisible = false;
|
|
49
50
|
this.isBuilt = false;
|
|
50
51
|
this.stopActionViewItemDisposables = this._register(( new DisposableStore()));
|
|
52
|
+
this.auxWindowCoordinates = ( new WeakMap());
|
|
51
53
|
this.$el = $('div.debug-toolbar');
|
|
52
54
|
this.$el.style.top = `${layoutService.mainContainerOffset.top}px`;
|
|
53
55
|
this.dragArea = append(this.$el, $('div.drag-area' + ThemeIcon.asCSSSelector(debugGripper)));
|
|
@@ -107,36 +109,47 @@ let DebugToolBar = class DebugToolBar extends Themable {
|
|
|
107
109
|
this._register(this.debugToolBarMenu.onDidChange(() => this.updateScheduler.schedule()));
|
|
108
110
|
this._register(this.actionBar.actionRunner.onDidRun((e) => {
|
|
109
111
|
if (e.error && !isCancellationError(e.error)) {
|
|
110
|
-
this.notificationService.
|
|
112
|
+
this.notificationService.warn(e.error);
|
|
111
113
|
}
|
|
112
114
|
this.telemetryService.publicLog2('workbenchActionExecuted', { id: e.action.id, from: 'debugActionsWidget' });
|
|
113
115
|
}));
|
|
114
|
-
this._register(addDisposableListener(mainWindow, EventType.RESIZE, () => this.setCoordinates()));
|
|
115
116
|
this._register(addDisposableGenericMouseUpListener(this.dragArea, (event) => {
|
|
116
117
|
const mouseClickEvent = ( new StandardMouseEvent(getWindow(this.dragArea), event));
|
|
118
|
+
const activeWindow = getWindow(this.layoutService.activeContainer);
|
|
117
119
|
if (mouseClickEvent.detail === 2) {
|
|
118
120
|
const widgetWidth = this.$el.clientWidth;
|
|
119
|
-
this.setCoordinates(0.5 *
|
|
121
|
+
this.setCoordinates(0.5 * activeWindow.innerWidth - 0.5 * widgetWidth, this.yDefault);
|
|
120
122
|
this.storePosition();
|
|
121
123
|
}
|
|
122
124
|
}));
|
|
123
125
|
this._register(addDisposableGenericMouseDownListener(this.dragArea, (event) => {
|
|
124
126
|
this.dragArea.classList.add('dragged');
|
|
127
|
+
getWindow(this.layoutService.activeContainer);
|
|
125
128
|
}));
|
|
126
129
|
this._register(this.layoutService.onDidChangePartVisibility(() => this.setYCoordinate()));
|
|
127
130
|
this._register(PixelRatio.onDidChange(() => this.setYCoordinate()));
|
|
131
|
+
const resizeListener = this._register(( new MutableDisposable()));
|
|
132
|
+
this._register(this.layoutService.onDidChangeActiveContainer(() => {
|
|
133
|
+
this._yRange = undefined;
|
|
134
|
+
this.layoutService.whenActiveContainerStylesLoaded.then(() => {
|
|
135
|
+
if (this.isBuilt) {
|
|
136
|
+
this.layoutService.activeContainer.appendChild(this.$el);
|
|
137
|
+
this.setCoordinates();
|
|
138
|
+
}
|
|
139
|
+
resizeListener.value = this._register(addDisposableListener(getWindow(this.layoutService.activeContainer), EventType.RESIZE, () => this.setYCoordinate()));
|
|
140
|
+
});
|
|
141
|
+
}));
|
|
128
142
|
}
|
|
129
143
|
storePosition() {
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (this.yCoordinate) {
|
|
144
|
+
const activeWindow = getWindow(this.layoutService.activeContainer);
|
|
145
|
+
const isMainWindow = this.layoutService.activeContainer === this.layoutService.mainContainer;
|
|
146
|
+
const left = this.$el.getBoundingClientRect().left / activeWindow.innerWidth;
|
|
147
|
+
if (isMainWindow) {
|
|
148
|
+
this.storageService.store(DEBUG_TOOLBAR_POSITION_KEY, left, 0 , 1 );
|
|
136
149
|
this.storageService.store(DEBUG_TOOLBAR_Y_KEY, this.yCoordinate, 0 , 1 );
|
|
137
150
|
}
|
|
138
151
|
else {
|
|
139
|
-
this.
|
|
152
|
+
this.auxWindowCoordinates.set(activeWindow, { x: left, y: this.yCoordinate });
|
|
140
153
|
}
|
|
141
154
|
}
|
|
142
155
|
updateStyles() {
|
|
@@ -161,16 +174,24 @@ let DebugToolBar = class DebugToolBar extends Themable {
|
|
|
161
174
|
return;
|
|
162
175
|
}
|
|
163
176
|
const widgetWidth = this.$el.clientWidth;
|
|
177
|
+
const currentWindow = getWindow(this.layoutService.activeContainer);
|
|
178
|
+
const isMainWindow = currentWindow === mainWindow;
|
|
164
179
|
if (x === undefined) {
|
|
165
|
-
const positionPercentage =
|
|
166
|
-
|
|
180
|
+
const positionPercentage = isMainWindow
|
|
181
|
+
? Number(this.storageService.get(DEBUG_TOOLBAR_POSITION_KEY, 0 ))
|
|
182
|
+
: this.auxWindowCoordinates.get(currentWindow)?.x;
|
|
183
|
+
x = positionPercentage !== undefined
|
|
184
|
+
? positionPercentage * currentWindow.innerWidth
|
|
185
|
+
: (0.5 * currentWindow.innerWidth - 0.5 * widgetWidth);
|
|
167
186
|
}
|
|
168
|
-
x =
|
|
187
|
+
x = clamp(x, 0, currentWindow.innerWidth - widgetWidth);
|
|
169
188
|
this.$el.style.left = `${x}px`;
|
|
170
189
|
if (y === undefined) {
|
|
171
|
-
y =
|
|
190
|
+
y = isMainWindow
|
|
191
|
+
? this.storageService.getNumber(DEBUG_TOOLBAR_Y_KEY, 0 )
|
|
192
|
+
: this.auxWindowCoordinates.get(currentWindow)?.y;
|
|
172
193
|
}
|
|
173
|
-
this.setYCoordinate(y);
|
|
194
|
+
this.setYCoordinate(y ?? this.yDefault);
|
|
174
195
|
}
|
|
175
196
|
setYCoordinate(y = this.yCoordinate) {
|
|
176
197
|
const [yMin, yMax] = this.yRange;
|
|
@@ -178,9 +199,12 @@ let DebugToolBar = class DebugToolBar extends Themable {
|
|
|
178
199
|
this.$el.style.top = `${y}px`;
|
|
179
200
|
this.yCoordinate = y;
|
|
180
201
|
}
|
|
202
|
+
get yDefault() {
|
|
203
|
+
return this.layoutService.mainContainerOffset.top;
|
|
204
|
+
}
|
|
181
205
|
get yRange() {
|
|
182
206
|
if (!this._yRange) {
|
|
183
|
-
const isTitleBarVisible = this.layoutService.isVisible("workbench.parts.titlebar" ,
|
|
207
|
+
const isTitleBarVisible = this.layoutService.isVisible("workbench.parts.titlebar" , getWindow(this.layoutService.activeContainer));
|
|
184
208
|
const yMin = isTitleBarVisible ? 0 : this.layoutService.mainContainerOffset.top;
|
|
185
209
|
let yMax = 0;
|
|
186
210
|
if (isTitleBarVisible) {
|
|
@@ -205,7 +229,7 @@ let DebugToolBar = class DebugToolBar extends Themable {
|
|
|
205
229
|
}
|
|
206
230
|
if (!this.isBuilt) {
|
|
207
231
|
this.isBuilt = true;
|
|
208
|
-
this.layoutService.
|
|
232
|
+
this.layoutService.activeContainer.appendChild(this.$el);
|
|
209
233
|
}
|
|
210
234
|
this.isVisible = true;
|
|
211
235
|
show(this.$el);
|
|
@@ -16,7 +16,8 @@ import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeServi
|
|
|
16
16
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
17
17
|
import { ViewsSubMenu, ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
18
18
|
import { WorkbenchStateContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
19
|
-
import {
|
|
19
|
+
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
20
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
20
21
|
import { StartDebugActionViewItem, FocusSessionActionViewItem } from './debugActionViewItems.js';
|
|
21
22
|
import { DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, DEBUG_CONFIGURE_COMMAND_ID, DEBUG_CONFIGURE_LABEL, FOCUS_SESSION_ID, STOP_ID, DISCONNECT_ID } from './debugCommands.js';
|
|
22
23
|
import { debugConfigure } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
|
|
@@ -261,7 +261,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
261
261
|
async goToInstructionAndOffset(instructionReference, offset, focus) {
|
|
262
262
|
let addr = this._referenceToMemoryAddress.get(instructionReference);
|
|
263
263
|
if (addr === undefined) {
|
|
264
|
-
await this.loadDisassembledInstructions(instructionReference, 0, -DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD, DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD);
|
|
264
|
+
await this.loadDisassembledInstructions(instructionReference, 0, -DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD, DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD * 2);
|
|
265
265
|
addr = this._referenceToMemoryAddress.get(instructionReference);
|
|
266
266
|
}
|
|
267
267
|
if (addr) {
|
|
@@ -6,7 +6,7 @@ import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/brows
|
|
|
6
6
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
7
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
8
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
9
|
-
import { renderViewTree } from '
|
|
9
|
+
import { renderViewTree } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
|
|
10
10
|
import { CONTEXT_LOADED_SCRIPTS_ITEM_TYPE, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
11
11
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
12
12
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
@@ -447,7 +447,7 @@ let LoadedScriptsView = class LoadedScriptsView extends ViewPane {
|
|
|
447
447
|
};
|
|
448
448
|
this._register(this.debugService.onDidNewSession(registerSessionListeners));
|
|
449
449
|
this.debugService.getModel().getSessions().forEach(registerSessionListeners);
|
|
450
|
-
this._register(this.debugService.onDidEndSession(session => {
|
|
450
|
+
this._register(this.debugService.onDidEndSession(({ session }) => {
|
|
451
451
|
root.remove(session.getId());
|
|
452
452
|
this.changeScheduler.schedule();
|
|
453
453
|
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
2
|
|
|
3
|
-
var css = ".codicon-debug-hint{cursor:pointer}.codicon-debug-hint:not([class*=codicon-debug-breakpoint]):not([class*=codicon-debug-stackframe]){opacity:.4!important}.inline-breakpoint-widget.codicon{align-items:center;display:flex!important}.inline-breakpoint-widget.codicon-debug-breakpoint-disabled{opacity:.7}.monaco-editor .inline-breakpoint-widget.line-start{left:-8px!important}.monaco-editor .debug-breakpoint-placeholder{display:inline-flex;margin-top:-1px;vertical-align:middle;width:.9em}.codicon-debug-breakpoint.codicon-debug-stackframe-focused:after,.codicon-debug-breakpoint.codicon-debug-stackframe:after{content:\"\\eb8a\";position:absolute}.monaco-editor .debug-top-stack-frame-column{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;align-items:center;display:inline-flex;font:normal normal normal 16px/1 codicon;margin-left:0;margin-right:4px;margin-top:-1px;text-rendering:auto;vertical-align:middle;width:.9em}.monaco-editor .debug-top-stack-frame-column.start-of-line{margin-top:0;position:absolute;top:50%;transform:translate(-17px,-50%)}.monaco-editor .inline-breakpoint-widget{cursor:pointer}.monaco-workbench .debug-view-content .monaco-list-row .monaco-tl-contents{overflow:hidden;text-overflow:ellipsis}.monaco-workbench .monaco-list-row .expression{display:flex}.monaco-workbench .debug-hover-widget .monaco-list-row .expression,.monaco-workbench .debug-pane .monaco-list-row .expression{font-family:var(--monaco-monospace-font);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:pre}.monaco-workbench.mac .debug-hover-widget .monaco-list-row .expression,.monaco-workbench.mac .debug-pane .monaco-list-row .expression{font-size:11px}.monaco-workbench .monaco-list-row .expression .value{margin-left:6px}.monaco-workbench .monaco-list-row .expression .lazy-button{align-self:center;border-radius:5px;display:none;margin-left:3px}.monaco-workbench .monaco-list-row .expression.lazy .lazy-button{display:inline}.monaco-workbench .monaco-list-row .expression .value a.link:hover{text-decoration:underline}.monaco-workbench .monaco-list-row .expression .value a.link.pointer{cursor:pointer}.monaco-workbench .monaco-list:focus .monaco-list-row.selected .expression .name,.monaco-workbench .monaco-list:focus .monaco-list-row.selected .expression .value{color:inherit}.monaco-workbench .monaco-list-row .expression .name.internal,.monaco-workbench .monaco-list-row .expression .name.virtual{opacity:.5}.monaco-workbench .monaco-list-row .expression .unavailable{font-style:italic}.monaco-workbench .debug-inline-value{background-color:var(--vscode-editor-inlineValuesBackground);color:var(--vscode-editor-inlineValuesForeground)}";
|
|
3
|
+
var css = ".codicon-debug-hint{cursor:pointer}.codicon-debug-hint:not([class*=codicon-debug-breakpoint]):not([class*=codicon-debug-stackframe]){opacity:.4!important}.inline-breakpoint-widget.codicon{align-items:center;display:flex!important}.inline-breakpoint-widget.codicon-debug-breakpoint-disabled{opacity:.7}.monaco-editor .inline-breakpoint-widget.line-start{left:-8px!important}.monaco-editor .debug-breakpoint-placeholder{display:inline-flex;margin-top:-1px;vertical-align:middle;width:.9em}.codicon-debug-breakpoint-conditional.codicon-debug-stackframe-focused:after,.codicon-debug-breakpoint-conditional.codicon-debug-stackframe:after,.codicon-debug-breakpoint.codicon-debug-stackframe-focused:after,.codicon-debug-breakpoint.codicon-debug-stackframe:after{content:\"\\eb8a\";position:absolute}.monaco-editor .debug-top-stack-frame-column{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;align-items:center;display:inline-flex;font:normal normal normal 16px/1 codicon;margin-left:0;margin-right:4px;margin-top:-1px;text-rendering:auto;vertical-align:middle;width:.9em}.monaco-editor .debug-top-stack-frame-column.start-of-line{margin-top:0;position:absolute;top:50%;transform:translate(-17px,-50%)}.monaco-editor .inline-breakpoint-widget{cursor:pointer}.monaco-workbench .debug-view-content .monaco-list-row .monaco-tl-contents{overflow:hidden;text-overflow:ellipsis}.monaco-workbench .monaco-list-row .expression{display:flex}.monaco-workbench .debug-hover-widget .monaco-list-row .expression,.monaco-workbench .debug-pane .monaco-list-row .expression{font-family:var(--monaco-monospace-font);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:pre}.monaco-workbench.mac .debug-hover-widget .monaco-list-row .expression,.monaco-workbench.mac .debug-pane .monaco-list-row .expression{font-size:11px}.monaco-workbench .monaco-list-row .expression .value{margin-left:6px}.monaco-workbench .monaco-list-row .expression .lazy-button{align-self:center;border-radius:5px;display:none;margin-left:3px}.monaco-workbench .monaco-list-row .expression.lazy .lazy-button{display:inline}.monaco-workbench .monaco-list-row .expression .value a.link:hover{text-decoration:underline}.monaco-workbench .monaco-list-row .expression .value a.link.pointer{cursor:pointer}.monaco-workbench .monaco-list:focus .monaco-list-row.selected .expression .name,.monaco-workbench .monaco-list:focus .monaco-list-row.selected .expression .value{color:inherit}.monaco-workbench .monaco-list-row .expression .name.internal,.monaco-workbench .monaco-list-row .expression .name.virtual{opacity:.5}.monaco-workbench .monaco-list-row .expression .unavailable{font-style:italic}.monaco-workbench .debug-inline-value{background-color:var(--vscode-editor-inlineValuesBackground);color:var(--vscode-editor-inlineValuesForeground)}";
|
|
4
4
|
n(css,{});
|
|
5
5
|
|
|
6
6
|
export { css, css as default };
|
|
@@ -23,7 +23,7 @@ import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/service
|
|
|
23
23
|
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
24
24
|
import { ITextResourcePropertiesService } from 'vscode/vscode/vs/editor/common/services/textResourceConfiguration';
|
|
25
25
|
import { SuggestController } from 'vscode/vscode/vs/editor/contrib/suggest/browser/suggestController';
|
|
26
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
26
|
+
import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
27
27
|
import { createAndFillInContextMenuActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
28
28
|
import { MenuId, registerAction2, Action2, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
29
29
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
@@ -42,7 +42,8 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
42
42
|
import { resolveColorValue, editorForeground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
43
43
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
44
44
|
import { FilterViewPane, ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
45
|
-
import {
|
|
45
|
+
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
46
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
46
47
|
import { getSimpleEditorOptions, getSimpleCodeEditorWidgetOptions } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
47
48
|
import { FocusSessionActionViewItem } from './debugActionViewItems.js';
|
|
48
49
|
import { debugConsoleEvaluationPrompt, debugConsoleClearAll } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
|
|
@@ -51,10 +52,10 @@ import { ReplFilter } from './replFilter.js';
|
|
|
51
52
|
import { ReplDelegate, ReplVariablesRenderer, ReplOutputElementRenderer, ReplEvaluationInputsRenderer, ReplGroupRenderer, ReplEvaluationResultsRenderer, ReplRawObjectsRenderer, ReplDataSource, ReplAccessibilityProvider } from './replViewer.js';
|
|
52
53
|
import { DEBUG_SCHEME, CONTEXT_MULTI_SESSION_REPL, CONTEXT_IN_DEBUG_REPL, REPL_VIEW_ID, IDebugService, CONTEXT_DEBUG_STATE, getStateLabel } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
53
54
|
import { Variable } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
54
|
-
import { ReplEvaluationResult, ReplGroup } from '
|
|
55
|
+
import { ReplEvaluationResult, ReplGroup } from 'vscode/vscode/vs/workbench/contrib/debug/common/replModel';
|
|
55
56
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
56
57
|
import { registerNavigableContainer } from 'vscode/vscode/vs/workbench/browser/actions/widgetNavigationCommands';
|
|
57
|
-
import {
|
|
58
|
+
import { IAudioCueService, AudioCue } from 'vscode/vscode/vs/platform/audioCues/browser/audioCueService';
|
|
58
59
|
|
|
59
60
|
var Repl_1, ReplOptions_1;
|
|
60
61
|
const $ = $$1;
|
|
@@ -94,6 +95,7 @@ let Repl = class Repl extends FilterViewPane {
|
|
|
94
95
|
this.logService = logService;
|
|
95
96
|
this.previousTreeScrollHeight = 0;
|
|
96
97
|
this.replInputLineCount = 1;
|
|
98
|
+
this.styleChangedWhenInvisible = false;
|
|
97
99
|
this.modelChangeListener = Disposable.None;
|
|
98
100
|
this.menu = menuService.createMenu(MenuId.DebugConsoleContext, contextKeyService);
|
|
99
101
|
this._register(this.menu);
|
|
@@ -128,7 +130,7 @@ let Repl = class Repl extends FilterViewPane {
|
|
|
128
130
|
}
|
|
129
131
|
this.multiSessionRepl.set(this.isMultiSessionView);
|
|
130
132
|
}));
|
|
131
|
-
this._register(this.debugService.onDidEndSession(async (
|
|
133
|
+
this._register(this.debugService.onDidEndSession(async () => {
|
|
132
134
|
await Promise.resolve();
|
|
133
135
|
this.multiSessionRepl.set(this.isMultiSessionView);
|
|
134
136
|
}));
|
|
@@ -147,6 +149,10 @@ let Repl = class Repl extends FilterViewPane {
|
|
|
147
149
|
this.replInput.setModel(this.model);
|
|
148
150
|
this.updateInputDecoration();
|
|
149
151
|
this.refreshReplElements(true);
|
|
152
|
+
if (this.styleChangedWhenInvisible) {
|
|
153
|
+
this.styleChangedWhenInvisible = false;
|
|
154
|
+
this.onDidStyleChange();
|
|
155
|
+
}
|
|
150
156
|
}
|
|
151
157
|
}));
|
|
152
158
|
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
@@ -278,6 +284,10 @@ let Repl = class Repl extends FilterViewPane {
|
|
|
278
284
|
}
|
|
279
285
|
}
|
|
280
286
|
onDidStyleChange() {
|
|
287
|
+
if (!this.isVisible()) {
|
|
288
|
+
this.styleChangedWhenInvisible = true;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
281
291
|
if (this.styleElement) {
|
|
282
292
|
this.replInput.updateOptions({
|
|
283
293
|
fontSize: this.replOptions.replConfiguration.fontSize,
|
|
@@ -849,7 +859,7 @@ registerAction2(class extends ViewAction {
|
|
|
849
859
|
super({
|
|
850
860
|
id: 'workbench.debug.panel.action.clearReplAction',
|
|
851
861
|
viewId: REPL_VIEW_ID,
|
|
852
|
-
title:
|
|
862
|
+
title: ( (localize2WithPath('vs/workbench/contrib/debug/browser/repl', 'clearRepl', 'Clear Console'))),
|
|
853
863
|
f1: true,
|
|
854
864
|
icon: debugConsoleClearAll,
|
|
855
865
|
menu: [{
|
|
@@ -865,9 +875,9 @@ registerAction2(class extends ViewAction {
|
|
|
865
875
|
});
|
|
866
876
|
}
|
|
867
877
|
runInView(_accessor, view) {
|
|
868
|
-
const
|
|
878
|
+
const audioCueService = _accessor.get(IAudioCueService);
|
|
869
879
|
view.clearRepl();
|
|
870
|
-
|
|
880
|
+
audioCueService.playAudioCue(AudioCue.clear);
|
|
871
881
|
}
|
|
872
882
|
});
|
|
873
883
|
registerAction2(class extends ViewAction {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { matchesFuzzy } from 'vscode/vscode/vs/base/common/filters';
|
|
2
2
|
import { splitGlobAware } from 'vscode/vscode/vs/base/common/glob';
|
|
3
|
-
import { ReplEvaluationInput, ReplEvaluationResult } from '
|
|
3
|
+
import { ReplEvaluationInput, ReplEvaluationResult } from 'vscode/vscode/vs/workbench/contrib/debug/common/replModel';
|
|
4
4
|
import { Variable } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
5
5
|
|
|
6
6
|
class ReplFilter {
|
|
@@ -13,12 +13,12 @@ import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
|
13
13
|
import { defaultCountBadgeStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
14
14
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
15
15
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
16
|
-
import { renderExpressionValue, AbstractExpressionsRenderer, renderVariable } from '
|
|
16
|
+
import { renderExpressionValue, AbstractExpressionsRenderer, renderVariable } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
|
|
17
17
|
import { handleANSIOutput } from './debugANSIHandling.js';
|
|
18
18
|
import { debugConsoleEvaluationInput } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
|
|
19
19
|
import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
20
20
|
import { Variable } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
21
|
-
import { ReplVariableElement, ReplEvaluationResult, ReplOutputElement, ReplEvaluationInput, ReplGroup, RawObjectReplElement } from '
|
|
21
|
+
import { ReplVariableElement, ReplEvaluationResult, ReplOutputElement, ReplEvaluationInput, ReplGroup, RawObjectReplElement } from 'vscode/vscode/vs/workbench/contrib/debug/common/replModel';
|
|
22
22
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
23
23
|
|
|
24
24
|
var ReplGroupRenderer_1, ReplOutputElementRenderer_1, ReplVariablesRenderer_1;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { append, $ as $$1 } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
3
|
import { HighlightedLabel } from 'vscode/vscode/vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
|
4
|
+
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
4
5
|
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
5
6
|
import { timeout, RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
7
|
+
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
6
8
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
7
9
|
import { createMatches } from 'vscode/vscode/vs/base/common/filters';
|
|
8
|
-
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
10
|
+
import { toDisposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
|
+
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
9
12
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
10
13
|
import { createAndFillInContextMenuActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
11
14
|
import { MenuId, registerAction2, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
@@ -24,10 +27,12 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
24
27
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
25
28
|
import { ViewAction, ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
26
29
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
27
|
-
import { AbstractExpressionsRenderer, renderVariable, renderViewTree } from '
|
|
30
|
+
import { AbstractExpressionsRenderer, renderVariable, renderViewTree } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
|
|
28
31
|
import { LinkDetector } from './linkDetector.js';
|
|
29
|
-
import { IDebugService, VARIABLES_VIEW_ID, CONTEXT_VARIABLES_FOCUSED, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED
|
|
32
|
+
import { IDebugService, VARIABLES_VIEW_ID, CONTEXT_VARIABLES_FOCUSED, CONTEXT_BREAK_WHEN_VALUE_CHANGES_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_ACCESSED_SUPPORTED, CONTEXT_BREAK_WHEN_VALUE_IS_READ_SUPPORTED } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
33
|
+
import { getContextForVariable } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugContext';
|
|
30
34
|
import { Variable, getUriForDebugMemory, Expression, ErrorScope, Scope, StackFrame } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
35
|
+
import { IDebugVisualizerService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugVisualizers';
|
|
31
36
|
import { IEditorService, SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
32
37
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
33
38
|
|
|
@@ -153,21 +158,7 @@ let VariablesView = class VariablesView extends ViewPane {
|
|
|
153
158
|
if (!(variable instanceof Variable) || !variable.value) {
|
|
154
159
|
return;
|
|
155
160
|
}
|
|
156
|
-
|
|
157
|
-
try {
|
|
158
|
-
const contextKeyService = await getContextForVariableMenuWithDataAccess(this.contextKeyService, variable);
|
|
159
|
-
const menu = toDispose.add(this.menuService.createMenu(MenuId.DebugVariablesContext, contextKeyService));
|
|
160
|
-
const context = getVariablesContext(variable);
|
|
161
|
-
const secondary = [];
|
|
162
|
-
createAndFillInContextMenuActions(menu, { arg: context, shouldForwardArgs: false }, { primary: [], secondary }, 'inline');
|
|
163
|
-
this.contextMenuService.showContextMenu({
|
|
164
|
-
getAnchor: () => e.anchor,
|
|
165
|
-
getActions: () => secondary
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
finally {
|
|
169
|
-
toDispose.dispose();
|
|
170
|
-
}
|
|
161
|
+
return openContextMenuForVariableTreeElement(this.contextKeyService, this.menuService, this.contextMenuService, MenuId.DebugVariablesContext, e);
|
|
171
162
|
}
|
|
172
163
|
};
|
|
173
164
|
VariablesView = ( __decorate([
|
|
@@ -183,6 +174,27 @@ VariablesView = ( __decorate([
|
|
|
183
174
|
( __param(10, ITelemetryService)),
|
|
184
175
|
( __param(11, IMenuService))
|
|
185
176
|
], VariablesView));
|
|
177
|
+
async function openContextMenuForVariableTreeElement(parentContextKeyService, menuService, contextMenuService, menuId, e) {
|
|
178
|
+
const variable = e.element;
|
|
179
|
+
if (!(variable instanceof Variable) || !variable.value) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const toDispose = ( new DisposableStore());
|
|
183
|
+
try {
|
|
184
|
+
const contextKeyService = await getContextForVariableMenuWithDataAccess(parentContextKeyService, variable);
|
|
185
|
+
const menu = toDispose.add(menuService.createMenu(menuId, contextKeyService));
|
|
186
|
+
const context = getVariablesContext(variable);
|
|
187
|
+
const secondary = [];
|
|
188
|
+
createAndFillInContextMenuActions(menu, { arg: context, shouldForwardArgs: false }, { primary: [], secondary }, 'inline');
|
|
189
|
+
contextMenuService.showContextMenu({
|
|
190
|
+
getAnchor: () => e.anchor,
|
|
191
|
+
getActions: () => secondary
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
finally {
|
|
195
|
+
toDispose.dispose();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
186
198
|
const getVariablesContext = (variable) => ({
|
|
187
199
|
sessionId: variable.getSession()?.getId(),
|
|
188
200
|
container: variable.parent instanceof Expression
|
|
@@ -193,7 +205,7 @@ const getVariablesContext = (variable) => ({
|
|
|
193
205
|
async function getContextForVariableMenuWithDataAccess(parentContext, variable) {
|
|
194
206
|
const session = variable.getSession();
|
|
195
207
|
if (!session || !session.capabilities.supportsDataBreakpoints) {
|
|
196
|
-
return
|
|
208
|
+
return getContextForVariableMenuBase(parentContext, variable);
|
|
197
209
|
}
|
|
198
210
|
const contextKeys = [];
|
|
199
211
|
dataBreakpointInfoResponse = await session.dataBreakpointInfo(variable.name, variable.parent.reference);
|
|
@@ -217,19 +229,11 @@ async function getContextForVariableMenuWithDataAccess(parentContext, variable)
|
|
|
217
229
|
}
|
|
218
230
|
}
|
|
219
231
|
}
|
|
220
|
-
return
|
|
232
|
+
return getContextForVariableMenuBase(parentContext, variable, contextKeys);
|
|
221
233
|
}
|
|
222
|
-
function
|
|
223
|
-
const session = variable.getSession();
|
|
224
|
-
const contextKeys = [
|
|
225
|
-
[CONTEXT_DEBUG_PROTOCOL_VARIABLE_MENU_CONTEXT.key, variable.variableMenuContext || ''],
|
|
226
|
-
[CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT.key, !!variable.evaluateName],
|
|
227
|
-
[CONTEXT_CAN_VIEW_MEMORY.key, !!session?.capabilities.supportsReadMemoryRequest && variable.memoryReference !== undefined],
|
|
228
|
-
[CONTEXT_VARIABLE_IS_READONLY.key, !!variable.presentationHint?.attributes?.includes('readOnly') || variable.presentationHint?.lazy],
|
|
229
|
-
...additionalContext,
|
|
230
|
-
];
|
|
234
|
+
function getContextForVariableMenuBase(parentContext, variable, additionalContext = []) {
|
|
231
235
|
variableInternalContext = variable;
|
|
232
|
-
return parentContext
|
|
236
|
+
return getContextForVariable(parentContext, variable, additionalContext);
|
|
233
237
|
}
|
|
234
238
|
function isStackFrame(obj) {
|
|
235
239
|
return obj instanceof StackFrame;
|
|
@@ -300,11 +304,13 @@ class ScopeErrorRenderer {
|
|
|
300
304
|
let VariablesRenderer = class VariablesRenderer extends AbstractExpressionsRenderer {
|
|
301
305
|
static { VariablesRenderer_1 = this; }
|
|
302
306
|
static { this.ID = 'variable'; }
|
|
303
|
-
constructor(linkDetector, menuService, contextKeyService, debugService, contextViewService) {
|
|
307
|
+
constructor(linkDetector, menuService, contextKeyService, visualization, contextMenuService, debugService, contextViewService) {
|
|
304
308
|
super(debugService, contextViewService);
|
|
305
309
|
this.linkDetector = linkDetector;
|
|
306
310
|
this.menuService = menuService;
|
|
307
311
|
this.contextKeyService = contextKeyService;
|
|
312
|
+
this.visualization = visualization;
|
|
313
|
+
this.contextMenuService = contextMenuService;
|
|
308
314
|
}
|
|
309
315
|
get templateId() {
|
|
310
316
|
return VariablesRenderer_1.ID;
|
|
@@ -340,9 +346,9 @@ let VariablesRenderer = class VariablesRenderer extends AbstractExpressionsRende
|
|
|
340
346
|
}
|
|
341
347
|
};
|
|
342
348
|
}
|
|
343
|
-
renderActionBar(actionBar, expression) {
|
|
349
|
+
renderActionBar(actionBar, expression, data) {
|
|
344
350
|
const variable = expression;
|
|
345
|
-
const contextKeyService =
|
|
351
|
+
const contextKeyService = getContextForVariableMenuBase(this.contextKeyService, variable);
|
|
346
352
|
const menu = this.menuService.createMenu(MenuId.DebugVariablesContext, contextKeyService);
|
|
347
353
|
const primary = [];
|
|
348
354
|
const context = getVariablesContext(variable);
|
|
@@ -350,13 +356,58 @@ let VariablesRenderer = class VariablesRenderer extends AbstractExpressionsRende
|
|
|
350
356
|
actionBar.clear();
|
|
351
357
|
actionBar.context = context;
|
|
352
358
|
actionBar.push(primary, { icon: true, label: false });
|
|
359
|
+
const cts = ( new CancellationTokenSource());
|
|
360
|
+
data.elementDisposable.add(toDisposable(() => cts.dispose(true)));
|
|
361
|
+
this.visualization.getApplicableFor(expression, cts.token).then(result => {
|
|
362
|
+
data.elementDisposable.add(result);
|
|
363
|
+
const actions = ( result.object.map(v => ( new Action(
|
|
364
|
+
'debugViz',
|
|
365
|
+
v.name,
|
|
366
|
+
v.iconClass || 'debug-viz-icon',
|
|
367
|
+
undefined,
|
|
368
|
+
this.useVisualizer(v, cts.token)
|
|
369
|
+
))));
|
|
370
|
+
if (actions.length === 0) ;
|
|
371
|
+
else if (actions.length === 1) {
|
|
372
|
+
actionBar.push(actions[0], { icon: true, label: false });
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
actionBar.push(( new Action('debugViz', ( localizeWithPath(
|
|
376
|
+
'vs/workbench/contrib/debug/browser/variablesView',
|
|
377
|
+
'useVisualizer',
|
|
378
|
+
'Visualize Variable...'
|
|
379
|
+
)), ThemeIcon.asClassName(Codicon.eye), undefined, () => this.pickVisualizer(actions, expression, data))), { icon: true, label: false });
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
pickVisualizer(actions, expression, data) {
|
|
384
|
+
this.contextMenuService.showContextMenu({
|
|
385
|
+
getAnchor: () => data.actionBar.getContainer(),
|
|
386
|
+
getActions: () => actions,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
useVisualizer(viz, token) {
|
|
390
|
+
return async () => {
|
|
391
|
+
const resolved = await viz.resolve(token);
|
|
392
|
+
if (token.isCancellationRequested) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (resolved.type === 0 ) {
|
|
396
|
+
viz.execute();
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
throw new Error('not implemented, yet');
|
|
400
|
+
}
|
|
401
|
+
};
|
|
353
402
|
}
|
|
354
403
|
};
|
|
355
404
|
VariablesRenderer = VariablesRenderer_1 = ( __decorate([
|
|
356
405
|
( __param(1, IMenuService)),
|
|
357
406
|
( __param(2, IContextKeyService)),
|
|
358
|
-
( __param(3,
|
|
359
|
-
( __param(4,
|
|
407
|
+
( __param(3, IDebugVisualizerService)),
|
|
408
|
+
( __param(4, IContextMenuService)),
|
|
409
|
+
( __param(5, IDebugService)),
|
|
410
|
+
( __param(6, IContextViewService))
|
|
360
411
|
], VariablesRenderer));
|
|
361
412
|
class VariablesAccessibilityProvider {
|
|
362
413
|
getWidgetAriaLabel() {
|
|
@@ -597,4 +648,4 @@ registerAction2(class extends ViewAction {
|
|
|
597
648
|
}
|
|
598
649
|
});
|
|
599
650
|
|
|
600
|
-
export { ADD_TO_WATCH_ID, BREAK_WHEN_VALUE_CHANGES_ID, BREAK_WHEN_VALUE_IS_ACCESSED_ID, BREAK_WHEN_VALUE_IS_READ_ID, COPY_EVALUATE_PATH_ID, COPY_VALUE_ID, SET_VARIABLE_ID, VIEW_MEMORY_ID, VariablesRenderer, VariablesView };
|
|
651
|
+
export { ADD_TO_WATCH_ID, BREAK_WHEN_VALUE_CHANGES_ID, BREAK_WHEN_VALUE_IS_ACCESSED_ID, BREAK_WHEN_VALUE_IS_READ_ID, COPY_EVALUATE_PATH_ID, COPY_VALUE_ID, SET_VARIABLE_ID, VIEW_MEMORY_ID, VariablesRenderer, VariablesView, openContextMenuForVariableTreeElement };
|
|
@@ -5,7 +5,7 @@ import { Variable, Expression } from 'vscode/vscode/vs/workbench/contrib/debug/c
|
|
|
5
5
|
import { IContextMenuService, IContextViewService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
6
6
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
7
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
8
|
-
import { AbstractExpressionsRenderer, renderExpressionValue, renderViewTree } from '
|
|
8
|
+
import { AbstractExpressionsRenderer, renderExpressionValue, renderViewTree } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
|
|
9
9
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
10
10
|
import { ViewAction, ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
11
11
|
import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
@@ -343,12 +343,32 @@ class WatchExpressionsDragAndDrop {
|
|
|
343
343
|
constructor(debugService) {
|
|
344
344
|
this.debugService = debugService;
|
|
345
345
|
}
|
|
346
|
-
onDragOver(data) {
|
|
346
|
+
onDragOver(data, targetElement, targetIndex, targetSector, originalEvent) {
|
|
347
347
|
if (!(data instanceof ElementsDragAndDropData)) {
|
|
348
348
|
return false;
|
|
349
349
|
}
|
|
350
350
|
const expressions = data.elements;
|
|
351
|
-
|
|
351
|
+
if (!(expressions.length > 0 && expressions[0] instanceof Expression)) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
let dropEffectPosition = undefined;
|
|
355
|
+
if (targetIndex === undefined) {
|
|
356
|
+
dropEffectPosition = "drop-target-after" ;
|
|
357
|
+
targetIndex = -1;
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
switch (targetSector) {
|
|
361
|
+
case 0 :
|
|
362
|
+
case 1 :
|
|
363
|
+
dropEffectPosition = "drop-target-before" ;
|
|
364
|
+
break;
|
|
365
|
+
case 2 :
|
|
366
|
+
case 3 :
|
|
367
|
+
dropEffectPosition = "drop-target-after" ;
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return { accept: true, effect: { type: 1 , position: dropEffectPosition }, feedback: [targetIndex] };
|
|
352
372
|
}
|
|
353
373
|
getDragURI(element) {
|
|
354
374
|
if (!(element instanceof Expression) || element === this.debugService.getViewModel().getSelectedExpression()?.expression) {
|
|
@@ -362,14 +382,33 @@ class WatchExpressionsDragAndDrop {
|
|
|
362
382
|
}
|
|
363
383
|
return undefined;
|
|
364
384
|
}
|
|
365
|
-
drop(data, targetElement) {
|
|
385
|
+
drop(data, targetElement, targetIndex, targetSector, originalEvent) {
|
|
366
386
|
if (!(data instanceof ElementsDragAndDropData)) {
|
|
367
387
|
return;
|
|
368
388
|
}
|
|
369
389
|
const draggedElement = data.elements[0];
|
|
390
|
+
if (!(draggedElement instanceof Expression)) {
|
|
391
|
+
throw new Error('Invalid dragged element');
|
|
392
|
+
}
|
|
370
393
|
const watches = this.debugService.getModel().getWatchExpressions();
|
|
371
|
-
const
|
|
372
|
-
|
|
394
|
+
const sourcePosition = watches.indexOf(draggedElement);
|
|
395
|
+
let targetPosition;
|
|
396
|
+
if (targetElement instanceof Expression) {
|
|
397
|
+
targetPosition = watches.indexOf(targetElement);
|
|
398
|
+
switch (targetSector) {
|
|
399
|
+
case 3 :
|
|
400
|
+
case 2 :
|
|
401
|
+
targetPosition++;
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
if (sourcePosition < targetPosition) {
|
|
405
|
+
targetPosition--;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
targetPosition = watches.length - 1;
|
|
410
|
+
}
|
|
411
|
+
this.debugService.moveWatchExpression(draggedElement.getId(), targetPosition);
|
|
373
412
|
}
|
|
374
413
|
dispose() { }
|
|
375
414
|
}
|