@opensumi/ide-debug 2.21.5-rc-1669016550.0 → 2.21.5
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/lib/browser/view/configuration/debug-configuration.module.less +5 -5
- package/lib/browser/view/configuration/debug-configuration.view.d.ts.map +1 -1
- package/lib/browser/view/configuration/debug-configuration.view.js +1 -1
- package/lib/browser/view/configuration/debug-configuration.view.js.map +1 -1
- package/lib/browser/view/configuration/debug-toolbar.view.js +2 -2
- package/lib/browser/view/configuration/debug-toolbar.view.js.map +1 -1
- package/lib/browser/view/console/debug-console.module.less +1 -1
- package/lib/browser/view/console/debug-console.view.js +2 -2
- package/lib/browser/view/console/debug-console.view.js.map +1 -1
- package/lib/browser/view/variables/debug-variables.module.less +1 -1
- package/lib/browser/view/variables/debug-variables.view.js +1 -1
- package/lib/browser/view/variables/debug-variables.view.js.map +1 -1
- package/lib/browser/view/watch/debug-watch.module.less +1 -1
- package/lib/browser/view/watch/debug-watch.view.js +1 -1
- package/lib/browser/view/watch/debug-watch.view.js.map +1 -1
- package/package.json +25 -26
- package/src/browser/assets/breakpoint-conditional-disabled.svg +0 -4
- package/src/browser/assets/breakpoint-conditional-unverified.svg +0 -4
- package/src/browser/assets/breakpoint-conditional.svg +0 -4
- package/src/browser/assets/breakpoint-disabled.svg +0 -4
- package/src/browser/assets/breakpoint-hint.svg +0 -4
- package/src/browser/assets/breakpoint-log-disabled.svg +0 -4
- package/src/browser/assets/breakpoint-log-unverified.svg +0 -4
- package/src/browser/assets/breakpoint-log.svg +0 -4
- package/src/browser/assets/breakpoint-unsupported.svg +0 -4
- package/src/browser/assets/breakpoint-unverified.svg +0 -4
- package/src/browser/assets/breakpoint.svg +0 -4
- package/src/browser/assets/breakpoints-activate-inverse.svg +0 -4
- package/src/browser/assets/breakpoints-activate.svg +0 -4
- package/src/browser/assets/configure-inverse.svg +0 -4
- package/src/browser/assets/configure.svg +0 -4
- package/src/browser/assets/continue-inverse.svg +0 -4
- package/src/browser/assets/current-and-breakpoint.svg +0 -4
- package/src/browser/assets/current-arrow.svg +0 -4
- package/src/browser/assets/remove-all-inverse.svg +0 -4
- package/src/browser/assets/remove-all.svg +0 -4
- package/src/browser/assets/repl-inverse.svg +0 -4
- package/src/browser/assets/repl.svg +0 -4
- package/src/browser/assets/restart-inverse.svg +0 -4
- package/src/browser/assets/stackframe-and-breakpoint.svg +0 -4
- package/src/browser/assets/stackframe-arrow.svg +0 -4
- package/src/browser/assets/start-inverse.svg +0 -4
- package/src/browser/breakpoint/breakpoint-decoration.ts +0 -57
- package/src/browser/breakpoint/breakpoint-manager.ts +0 -348
- package/src/browser/breakpoint/breakpoint-marker.ts +0 -70
- package/src/browser/breakpoint/index.ts +0 -3
- package/src/browser/components/debug-action/index.module.less +0 -73
- package/src/browser/components/debug-action/index.tsx +0 -40
- package/src/browser/components/debug-exception-widget.less +0 -42
- package/src/browser/components/floating-click-widget/index.module.less +0 -5
- package/src/browser/components/floating-click-widget/index.tsx +0 -21
- package/src/browser/components/index.ts +0 -1
- package/src/browser/contextkeys/debug-call-stack-item-type-key.ts +0 -4
- package/src/browser/contextkeys/debug-contextkey.service.ts +0 -54
- package/src/browser/contextkeys/index.ts +0 -1
- package/src/browser/debug-ansi-handle.ts +0 -521
- package/src/browser/debug-configuration-manager.ts +0 -513
- package/src/browser/debug-configuration-model.ts +0 -66
- package/src/browser/debug-contribution.ts +0 -904
- package/src/browser/debug-exception-widget.tsx +0 -89
- package/src/browser/debug-link-detector.ts +0 -234
- package/src/browser/debug-memory.ts +0 -220
- package/src/browser/debug-preferences.ts +0 -70
- package/src/browser/debug-progress.service.ts +0 -122
- package/src/browser/debug-schema-updater.ts +0 -67
- package/src/browser/debug-service.ts +0 -42
- package/src/browser/debug-session-connection.ts +0 -333
- package/src/browser/debug-session-contribution.ts +0 -57
- package/src/browser/debug-session-manager.ts +0 -622
- package/src/browser/debug-session.ts +0 -1179
- package/src/browser/debug-style.less +0 -128
- package/src/browser/debugUtils.ts +0 -110
- package/src/browser/editor/debug-breakpoint-widget.ts +0 -99
- package/src/browser/editor/debug-breakpoint-zone-widget.tsx +0 -262
- package/src/browser/editor/debug-breakpoint.module.less +0 -31
- package/src/browser/editor/debug-editor-contribution.ts +0 -590
- package/src/browser/editor/debug-expression-provider.ts +0 -101
- package/src/browser/editor/debug-hover-model.ts +0 -38
- package/src/browser/editor/debug-hover-source.ts +0 -107
- package/src/browser/editor/debug-hover-tree.model.service.ts +0 -332
- package/src/browser/editor/debug-hover-widget.tsx +0 -200
- package/src/browser/editor/debug-hover.module.less +0 -29
- package/src/browser/editor/debug-hover.view.tsx +0 -147
- package/src/browser/editor/debug-model-manager.ts +0 -220
- package/src/browser/editor/debug-model.ts +0 -853
- package/src/browser/editor/debug-run-to-cursor.service.ts +0 -180
- package/src/browser/editor/debug-styles.ts +0 -66
- package/src/browser/editor/evaluatable-expression.ts +0 -47
- package/src/browser/editor/index.ts +0 -6
- package/src/browser/index.ts +0 -135
- package/src/browser/markers/index.ts +0 -2
- package/src/browser/markers/marker-manager.ts +0 -201
- package/src/browser/markers/marker.ts +0 -20
- package/src/browser/model/debug-source.ts +0 -144
- package/src/browser/model/debug-stack-frame.ts +0 -111
- package/src/browser/model/debug-thread.ts +0 -186
- package/src/browser/model/debug-watch.ts +0 -130
- package/src/browser/model/index.ts +0 -4
- package/src/browser/preferences/launch-folder-preference-provider.ts +0 -23
- package/src/browser/preferences/launch-preferences-contribution.ts +0 -9
- package/src/browser/preferences/launch-preferences.ts +0 -16
- package/src/browser/tree/debug-console-tree-node.define.tsx +0 -76
- package/src/browser/tree/debug-tree-node.define.ts +0 -768
- package/src/browser/tree/index.ts +0 -2
- package/src/browser/view/breakpoints/debug-breakpoints.module.less +0 -72
- package/src/browser/view/breakpoints/debug-breakpoints.service.ts +0 -217
- package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +0 -174
- package/src/browser/view/configuration/debug-configuration.module.less +0 -110
- package/src/browser/view/configuration/debug-configuration.service.ts +0 -170
- package/src/browser/view/configuration/debug-configuration.view.tsx +0 -252
- package/src/browser/view/configuration/debug-toolbar.service.ts +0 -167
- package/src/browser/view/configuration/debug-toolbar.view.tsx +0 -335
- package/src/browser/view/console/debug-console-filter.model.ts +0 -49
- package/src/browser/view/console/debug-console-filter.service.ts +0 -81
- package/src/browser/view/console/debug-console-filter.view.tsx +0 -78
- package/src/browser/view/console/debug-console-model.ts +0 -48
- package/src/browser/view/console/debug-console-session.ts +0 -164
- package/src/browser/view/console/debug-console-toolbar.view.tsx +0 -28
- package/src/browser/view/console/debug-console-tree.model.service.ts +0 -550
- package/src/browser/view/console/debug-console.contribution.ts +0 -181
- package/src/browser/view/console/debug-console.module.less +0 -372
- package/src/browser/view/console/debug-console.service.ts +0 -433
- package/src/browser/view/console/debug-console.view.tsx +0 -500
- package/src/browser/view/debug-view-model.ts +0 -182
- package/src/browser/view/frames/debug-call-stack-frame.view.tsx +0 -224
- package/src/browser/view/frames/debug-call-stack-session.view.tsx +0 -237
- package/src/browser/view/frames/debug-call-stack-thread.view.tsx +0 -93
- package/src/browser/view/frames/debug-call-stack.contribution.ts +0 -88
- package/src/browser/view/frames/debug-call-stack.module.less +0 -193
- package/src/browser/view/frames/debug-call-stack.operation.tsx +0 -97
- package/src/browser/view/frames/debug-call-stack.service.ts +0 -105
- package/src/browser/view/frames/debug-call-stack.view.tsx +0 -43
- package/src/browser/view/variables/debug-variables-model.ts +0 -38
- package/src/browser/view/variables/debug-variables-tree.model.service.ts +0 -467
- package/src/browser/view/variables/debug-variables.contribution.ts +0 -244
- package/src/browser/view/variables/debug-variables.module.less +0 -148
- package/src/browser/view/variables/debug-variables.view.tsx +0 -303
- package/src/browser/view/watch/debug-watch-model.ts +0 -38
- package/src/browser/view/watch/debug-watch-tree.model.service.ts +0 -567
- package/src/browser/view/watch/debug-watch.contribution.ts +0 -167
- package/src/browser/view/watch/debug-watch.module.less +0 -188
- package/src/browser/view/watch/debug-watch.view.tsx +0 -337
- package/src/common/constants.ts +0 -81
- package/src/common/debug-breakpoint.ts +0 -43
- package/src/common/debug-configuration.ts +0 -68
- package/src/common/debug-editor.ts +0 -4
- package/src/common/debug-hover.ts +0 -31
- package/src/common/debug-model.ts +0 -247
- package/src/common/debug-progress.ts +0 -8
- package/src/common/debug-schema-updater.ts +0 -1
- package/src/common/debug-service.ts +0 -176
- package/src/common/debug-session-options.ts +0 -19
- package/src/common/debug-session.ts +0 -200
- package/src/common/evaluatable-expression.ts +0 -43
- package/src/common/index.ts +0 -14
- package/src/common/inline-values.ts +0 -77
- package/src/common/terminal.ts +0 -163
- package/src/common/types.ts +0 -86
- package/src/index.ts +0 -1
|
@@ -1,467 +0,0 @@
|
|
|
1
|
-
import isEqual from 'lodash/isEqual';
|
|
2
|
-
|
|
3
|
-
import { Injectable, Autowired, INJECTOR_TOKEN, Injector } from '@opensumi/di';
|
|
4
|
-
import {
|
|
5
|
-
TreeModel,
|
|
6
|
-
DecorationsManager,
|
|
7
|
-
Decoration,
|
|
8
|
-
IRecycleTreeHandle,
|
|
9
|
-
TreeNodeType,
|
|
10
|
-
TreeNodeEvent,
|
|
11
|
-
} from '@opensumi/ide-components';
|
|
12
|
-
import {
|
|
13
|
-
Emitter,
|
|
14
|
-
ThrottledDelayer,
|
|
15
|
-
Deferred,
|
|
16
|
-
Event,
|
|
17
|
-
DisposableCollection,
|
|
18
|
-
IClipboardService,
|
|
19
|
-
} from '@opensumi/ide-core-browser';
|
|
20
|
-
import { AbstractContextMenuService, MenuId, ICtxMenuRenderer } from '@opensumi/ide-core-browser/lib/menu/next';
|
|
21
|
-
import { DebugProtocol } from '@opensumi/vscode-debugprotocol';
|
|
22
|
-
|
|
23
|
-
import { DebugSession } from '../../debug-session';
|
|
24
|
-
import {
|
|
25
|
-
ExpressionContainer,
|
|
26
|
-
ExpressionNode,
|
|
27
|
-
DebugVariableRoot,
|
|
28
|
-
DebugVariableContainer,
|
|
29
|
-
DebugVariable,
|
|
30
|
-
DebugScope,
|
|
31
|
-
} from '../../tree/debug-tree-node.define';
|
|
32
|
-
import { DebugViewModel } from '../debug-view-model';
|
|
33
|
-
|
|
34
|
-
import { DebugContextKey } from './../../contextkeys/debug-contextkey.service';
|
|
35
|
-
import { DebugVariablesModel } from './debug-variables-model';
|
|
36
|
-
import styles from './debug-variables.module.less';
|
|
37
|
-
|
|
38
|
-
export interface IDebugVariablesHandle extends IRecycleTreeHandle {
|
|
39
|
-
hasDirectFocus: () => boolean;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type DebugVariableWithRawScope = DebugScope | DebugVariableContainer;
|
|
43
|
-
|
|
44
|
-
class KeepExpandedScopesModel {
|
|
45
|
-
private _keepExpandedScopesMap = new Map<DebugProtocol.Scope, Array<number>>();
|
|
46
|
-
constructor() {}
|
|
47
|
-
|
|
48
|
-
private getMirrorScope(item: DebugVariableWithRawScope) {
|
|
49
|
-
return Array.from(this._keepExpandedScopesMap.keys()).find((f) => isEqual(f, item.getRawScope()));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
set(item: DebugVariableWithRawScope): void {
|
|
53
|
-
const scope = item.getRawScope();
|
|
54
|
-
if (scope) {
|
|
55
|
-
const keepScope = this.getMirrorScope(item);
|
|
56
|
-
if (keepScope) {
|
|
57
|
-
const kScopeVars = this._keepExpandedScopesMap.get(keepScope)!;
|
|
58
|
-
let nScopeVars: number[];
|
|
59
|
-
if (item.expanded) {
|
|
60
|
-
nScopeVars = Array.from(new Set([...kScopeVars, item.variablesReference]));
|
|
61
|
-
} else {
|
|
62
|
-
nScopeVars = kScopeVars.filter((v) => v !== item.variablesReference);
|
|
63
|
-
}
|
|
64
|
-
this._keepExpandedScopesMap.set(keepScope, nScopeVars);
|
|
65
|
-
} else {
|
|
66
|
-
this._keepExpandedScopesMap.set(scope, item.expanded ? [item.variablesReference] : []);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
get(item: DebugVariableWithRawScope): number[] {
|
|
72
|
-
const keepScope = this.getMirrorScope(item);
|
|
73
|
-
if (keepScope) {
|
|
74
|
-
return this._keepExpandedScopesMap.get(keepScope) || [];
|
|
75
|
-
} else {
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
clear(): void {
|
|
81
|
-
this._keepExpandedScopesMap.clear();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@Injectable()
|
|
86
|
-
export class DebugVariablesModelService {
|
|
87
|
-
private static DEFAULT_TRIGGER_DELAY = 200;
|
|
88
|
-
|
|
89
|
-
@Autowired(INJECTOR_TOKEN)
|
|
90
|
-
private readonly injector: Injector;
|
|
91
|
-
|
|
92
|
-
@Autowired(ICtxMenuRenderer)
|
|
93
|
-
private readonly ctxMenuRenderer: ICtxMenuRenderer;
|
|
94
|
-
|
|
95
|
-
@Autowired(AbstractContextMenuService)
|
|
96
|
-
private readonly contextMenuService: AbstractContextMenuService;
|
|
97
|
-
|
|
98
|
-
@Autowired(DebugViewModel)
|
|
99
|
-
protected readonly viewModel: DebugViewModel;
|
|
100
|
-
|
|
101
|
-
@Autowired(IClipboardService)
|
|
102
|
-
private readonly clipboardService: IClipboardService;
|
|
103
|
-
|
|
104
|
-
@Autowired(DebugContextKey)
|
|
105
|
-
private readonly debugContextKey: DebugContextKey;
|
|
106
|
-
|
|
107
|
-
private _activeTreeModel: DebugVariablesModel | undefined;
|
|
108
|
-
|
|
109
|
-
private _decorations: DecorationsManager;
|
|
110
|
-
private _debugVariablesTreeHandle: IDebugVariablesHandle;
|
|
111
|
-
private _currentVariableInternalContext: DebugVariable | DebugVariableContainer | undefined;
|
|
112
|
-
|
|
113
|
-
public flushEventQueueDeferred: Deferred<void> | null;
|
|
114
|
-
|
|
115
|
-
// 装饰器
|
|
116
|
-
private selectedDecoration: Decoration = new Decoration(styles.mod_selected); // 选中态
|
|
117
|
-
private focusedDecoration: Decoration = new Decoration(styles.mod_focused); // 焦点态
|
|
118
|
-
private contextMenuDecoration: Decoration = new Decoration(styles.mod_actived); // 右键菜单激活态
|
|
119
|
-
private loadingDecoration: Decoration = new Decoration(styles.mod_loading); // 加载态
|
|
120
|
-
// 即使选中态也是焦点态的节点
|
|
121
|
-
private _focusedNode: ExpressionContainer | ExpressionNode | undefined;
|
|
122
|
-
// 选中态的节点
|
|
123
|
-
private _selectedNodes: (ExpressionContainer | ExpressionNode)[] = [];
|
|
124
|
-
// 右键菜单选中态的节点
|
|
125
|
-
private _contextMenuNode: ExpressionContainer | ExpressionNode | undefined;
|
|
126
|
-
|
|
127
|
-
private onDidRefreshedEmitter: Emitter<void> = new Emitter();
|
|
128
|
-
private onDidUpdateTreeModelEmitter: Emitter<TreeModel | void> = new Emitter();
|
|
129
|
-
|
|
130
|
-
private flushDispatchChangeDelayer = new ThrottledDelayer<void>(DebugVariablesModelService.DEFAULT_TRIGGER_DELAY);
|
|
131
|
-
|
|
132
|
-
private disposableCollection: DisposableCollection = new DisposableCollection();
|
|
133
|
-
|
|
134
|
-
private keepExpandedScopesModel: KeepExpandedScopesModel = new KeepExpandedScopesModel();
|
|
135
|
-
|
|
136
|
-
constructor() {
|
|
137
|
-
this.listenViewModelChange();
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
get flushEventQueuePromise() {
|
|
141
|
-
return this.flushEventQueueDeferred && this.flushEventQueueDeferred.promise;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
get treeHandle() {
|
|
145
|
-
return this._debugVariablesTreeHandle;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
get decorations() {
|
|
149
|
-
return this._decorations;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
get treeModel() {
|
|
153
|
-
return this._activeTreeModel;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
get currentVariableInternalContext() {
|
|
157
|
-
return this._currentVariableInternalContext;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// 既是选中态,也是焦点态节点
|
|
161
|
-
get focusedNode() {
|
|
162
|
-
return this._focusedNode;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// 是选中态,非焦点态节点
|
|
166
|
-
get selectedNodes() {
|
|
167
|
-
return this._selectedNodes;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// 右键菜单激活态的节点
|
|
171
|
-
get contextMenuNode() {
|
|
172
|
-
return this._contextMenuNode;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
get onDidUpdateTreeModel(): Event<TreeModel | void> {
|
|
176
|
-
return this.onDidUpdateTreeModelEmitter.event;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
get onDidRefreshed(): Event<void> {
|
|
180
|
-
return this.onDidRefreshedEmitter.event;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
dispose() {
|
|
184
|
-
if (!this.disposableCollection.disposed) {
|
|
185
|
-
this.disposableCollection.dispose();
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
listenViewModelChange() {
|
|
190
|
-
this.viewModel.onDidChange(async () => {
|
|
191
|
-
if (!this.flushDispatchChangeDelayer.isTriggered()) {
|
|
192
|
-
this.flushDispatchChangeDelayer.cancel();
|
|
193
|
-
}
|
|
194
|
-
this.flushDispatchChangeDelayer.trigger(async () => {
|
|
195
|
-
if (this.viewModel && this.viewModel.currentSession && !this.viewModel.currentSession.terminated) {
|
|
196
|
-
const currentTreeModel = await this.initTreeModel(this.viewModel.currentSession);
|
|
197
|
-
this._activeTreeModel = currentTreeModel;
|
|
198
|
-
await this._activeTreeModel?.ensureReady;
|
|
199
|
-
/**
|
|
200
|
-
* 如果变量面板全部都是折叠状态
|
|
201
|
-
* 则需要找到当前 scope 作用域的 expensive 为 false 的变量列表,并默认展开它们
|
|
202
|
-
* PS: 一般的情况下有 Local
|
|
203
|
-
* */
|
|
204
|
-
const scopes = (this._activeTreeModel?.root.children as Array<DebugVariableWithRawScope>) || [];
|
|
205
|
-
if (scopes.length > 0 && scopes.every((s: DebugScope) => !s.expanded)) {
|
|
206
|
-
for (const s of scopes) {
|
|
207
|
-
if ((s as DebugScope).getRawScope().expensive === false && !s.expanded) {
|
|
208
|
-
await this.toggleDirectory(s);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
const execExpands = async (data: Array<DebugVariableWithRawScope>) => {
|
|
214
|
-
for (const s of data) {
|
|
215
|
-
const cacheExpands = this.keepExpandedScopesModel.get(s);
|
|
216
|
-
if (cacheExpands.includes(s.variablesReference)) {
|
|
217
|
-
await s.setExpanded(true);
|
|
218
|
-
if (Array.isArray(s.children)) {
|
|
219
|
-
await execExpands(s.children as Array<DebugVariableWithRawScope>);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
scopes.forEach(async (s) => {
|
|
226
|
-
if (Array.isArray(s.children)) {
|
|
227
|
-
await execExpands(s.children as Array<DebugVariableWithRawScope>);
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
} else {
|
|
231
|
-
this._activeTreeModel = undefined;
|
|
232
|
-
this.keepExpandedScopesModel.clear();
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
this.onDidUpdateTreeModelEmitter.fire(this._activeTreeModel);
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
listenTreeViewChange() {
|
|
241
|
-
this.dispose();
|
|
242
|
-
this.disposableCollection.push(
|
|
243
|
-
this.treeModel?.root.watcher.on(TreeNodeEvent.WillResolveChildren, (target) => {
|
|
244
|
-
this.loadingDecoration.addTarget(target);
|
|
245
|
-
}),
|
|
246
|
-
);
|
|
247
|
-
this.disposableCollection.push(
|
|
248
|
-
this.treeModel?.root.watcher.on(TreeNodeEvent.DidResolveChildren, (target) => {
|
|
249
|
-
this.loadingDecoration.removeTarget(target);
|
|
250
|
-
}),
|
|
251
|
-
);
|
|
252
|
-
this.disposableCollection.push(
|
|
253
|
-
this.treeModel!.onWillUpdate(() => {
|
|
254
|
-
// 更新树前更新下选中节点
|
|
255
|
-
if (this.selectedNodes.length !== 0) {
|
|
256
|
-
// 仅处理一下单选情况
|
|
257
|
-
const node = this.treeModel?.root.getTreeNodeByPath(this.selectedNodes[0].path);
|
|
258
|
-
this.selectedDecoration.addTarget(node as ExpressionNode);
|
|
259
|
-
}
|
|
260
|
-
}),
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
async initTreeModel(session?: DebugSession) {
|
|
265
|
-
// 根据是否为多工作区创建不同根节点
|
|
266
|
-
const root = new DebugVariableRoot(session);
|
|
267
|
-
if (!root) {
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
this._activeTreeModel = this.injector.get<any>(DebugVariablesModel, [root]);
|
|
271
|
-
|
|
272
|
-
this.initDecorations(root);
|
|
273
|
-
this.listenTreeViewChange();
|
|
274
|
-
return this._activeTreeModel;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
initDecorations(root) {
|
|
278
|
-
this._decorations = new DecorationsManager(root as any);
|
|
279
|
-
this._decorations.addDecoration(this.selectedDecoration);
|
|
280
|
-
this._decorations.addDecoration(this.focusedDecoration);
|
|
281
|
-
this._decorations.addDecoration(this.contextMenuDecoration);
|
|
282
|
-
this._decorations.addDecoration(this.loadingDecoration);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// 清空其他选中/焦点态节点,更新当前焦点节点
|
|
286
|
-
activeNodeDecoration = (target: ExpressionContainer | ExpressionNode, dispatchChange = true) => {
|
|
287
|
-
if (this.contextMenuNode) {
|
|
288
|
-
this.contextMenuDecoration.removeTarget(this.contextMenuNode);
|
|
289
|
-
this._contextMenuNode = undefined;
|
|
290
|
-
}
|
|
291
|
-
if (target) {
|
|
292
|
-
if (this.selectedNodes.length > 0) {
|
|
293
|
-
// 因为选择装饰器可能通过其他方式添加而不能及时在selectedNodes上更新
|
|
294
|
-
// 故这里遍历所有选中装饰器的节点进行一次统一清理
|
|
295
|
-
for (const target of this.selectedDecoration.appliedTargets.keys()) {
|
|
296
|
-
this.selectedDecoration.removeTarget(target);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
if (this.focusedNode) {
|
|
300
|
-
this.focusedDecoration.removeTarget(this.focusedNode);
|
|
301
|
-
}
|
|
302
|
-
this.selectedDecoration.addTarget(target);
|
|
303
|
-
this.focusedDecoration.addTarget(target);
|
|
304
|
-
this._focusedNode = target;
|
|
305
|
-
this._selectedNodes = [target];
|
|
306
|
-
|
|
307
|
-
if (dispatchChange) {
|
|
308
|
-
// 通知视图更新
|
|
309
|
-
this.treeModel?.dispatchChange();
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
// 右键菜单焦点态切换
|
|
315
|
-
activeNodeActivedDecoration = (target: ExpressionContainer | ExpressionNode) => {
|
|
316
|
-
if (this.contextMenuNode) {
|
|
317
|
-
this.contextMenuDecoration.removeTarget(this.contextMenuNode);
|
|
318
|
-
}
|
|
319
|
-
if (this.focusedNode) {
|
|
320
|
-
this.focusedDecoration.removeTarget(this.focusedNode);
|
|
321
|
-
this._focusedNode = undefined;
|
|
322
|
-
}
|
|
323
|
-
this.contextMenuDecoration.addTarget(target);
|
|
324
|
-
this._contextMenuNode = target;
|
|
325
|
-
this.treeModel?.dispatchChange();
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
// 取消选中节点焦点
|
|
329
|
-
enactiveNodeDecoration = () => {
|
|
330
|
-
if (this.focusedNode) {
|
|
331
|
-
this.focusedDecoration.removeTarget(this.focusedNode);
|
|
332
|
-
this._focusedNode = undefined;
|
|
333
|
-
}
|
|
334
|
-
if (this.contextMenuNode) {
|
|
335
|
-
this.contextMenuDecoration.removeTarget(this.contextMenuNode);
|
|
336
|
-
}
|
|
337
|
-
this.treeModel?.dispatchChange();
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
removeNodeDecoration() {
|
|
341
|
-
if (!this.decorations) {
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
this.decorations.removeDecoration(this.selectedDecoration);
|
|
345
|
-
this.decorations.removeDecoration(this.focusedDecoration);
|
|
346
|
-
this.decorations.removeDecoration(this.loadingDecoration);
|
|
347
|
-
this.decorations.removeDecoration(this.contextMenuDecoration);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
handleContextMenu = (
|
|
351
|
-
ev: React.MouseEvent,
|
|
352
|
-
expression?: DebugScope | DebugVariableContainer | DebugVariable | undefined,
|
|
353
|
-
) => {
|
|
354
|
-
ev.stopPropagation();
|
|
355
|
-
ev.preventDefault();
|
|
356
|
-
|
|
357
|
-
if (!expression || expression instanceof DebugScope) {
|
|
358
|
-
this.enactiveNodeDecoration();
|
|
359
|
-
this.debugContextKey.contextVariableEvaluateNamePresent.set(false);
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
this._currentVariableInternalContext = expression;
|
|
364
|
-
const { x, y } = ev.nativeEvent;
|
|
365
|
-
|
|
366
|
-
if (expression) {
|
|
367
|
-
this.activeNodeActivedDecoration(expression);
|
|
368
|
-
this.debugContextKey.contextDebugProtocolVariableMenu.set(expression.variableMenuContext);
|
|
369
|
-
this.debugContextKey.contextVariableEvaluateNamePresent.set(
|
|
370
|
-
!!(expression as DebugVariableContainer | DebugVariable).evaluateName,
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
// 决定某一变量是否允许以十六进制视图查看
|
|
375
|
-
if (expression.session?.capabilities.supportsReadMemoryRequest && expression.memoryReference !== undefined) {
|
|
376
|
-
this.debugContextKey.contextCanViewMemory.set(true);
|
|
377
|
-
} else {
|
|
378
|
-
this.debugContextKey.contextCanViewMemory.set(false);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
const menus = this.contextMenuService.createMenu({
|
|
382
|
-
id: MenuId.DebugVariablesContext,
|
|
383
|
-
contextKeyService: this.debugContextKey.contextKeyScoped,
|
|
384
|
-
});
|
|
385
|
-
const menuNodes = menus.getMergedMenuNodes();
|
|
386
|
-
menus.dispose();
|
|
387
|
-
this.ctxMenuRenderer.show({
|
|
388
|
-
anchor: { x, y },
|
|
389
|
-
menuNodes,
|
|
390
|
-
args: [expression.toDebugProtocolObject()],
|
|
391
|
-
});
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
handleTreeHandler(handle: IDebugVariablesHandle) {
|
|
395
|
-
this._debugVariablesTreeHandle = {
|
|
396
|
-
...handle,
|
|
397
|
-
getModel: () => this.treeModel!,
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
handleTreeBlur = () => {
|
|
402
|
-
// 清空焦点状态
|
|
403
|
-
this.enactiveNodeDecoration();
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
handleItemClick = (item: ExpressionContainer | ExpressionNode) => {
|
|
407
|
-
// 单选操作默认先更新选中状态
|
|
408
|
-
this.activeNodeDecoration(item);
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
handleTwistierClick = (item: ExpressionContainer | ExpressionNode, type: TreeNodeType) => {
|
|
412
|
-
if (type === TreeNodeType.CompositeTreeNode) {
|
|
413
|
-
this.activeNodeDecoration(item, false);
|
|
414
|
-
this.toggleDirectory(item as DebugVariableWithRawScope);
|
|
415
|
-
} else {
|
|
416
|
-
this.activeNodeDecoration(item);
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
toggleDirectory = async (item: DebugVariableWithRawScope) => {
|
|
421
|
-
if (item.expanded) {
|
|
422
|
-
item.setCollapsed();
|
|
423
|
-
} else {
|
|
424
|
-
await item.setExpanded(true);
|
|
425
|
-
}
|
|
426
|
-
this.keepExpandedScopesModel.set(item);
|
|
427
|
-
};
|
|
428
|
-
|
|
429
|
-
async copyEvaluateName(node: DebugVariableContainer | DebugVariable | undefined) {
|
|
430
|
-
if (!node) {
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
await this.clipboardService.writeText(node.evaluateName);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
async copyValue(node: DebugVariableContainer | DebugVariable | undefined) {
|
|
438
|
-
if (!node) {
|
|
439
|
-
return;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
const getClipboardValue = async () => {
|
|
443
|
-
if (node.session && node.session.capabilities.supportsValueFormattingOptions) {
|
|
444
|
-
try {
|
|
445
|
-
const {
|
|
446
|
-
variable: { evaluateName },
|
|
447
|
-
} = node;
|
|
448
|
-
if (evaluateName) {
|
|
449
|
-
const body = await node.session.evaluate(evaluateName, 'clipboard');
|
|
450
|
-
if (body) {
|
|
451
|
-
return body.result;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
return '';
|
|
455
|
-
} catch (err) {
|
|
456
|
-
return '';
|
|
457
|
-
}
|
|
458
|
-
} else {
|
|
459
|
-
return node.value;
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
const value = await getClipboardValue();
|
|
463
|
-
if (value) {
|
|
464
|
-
await this.clipboardService.writeText(value);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import { Autowired } from '@opensumi/di';
|
|
2
|
-
import {
|
|
3
|
-
Domain,
|
|
4
|
-
CommandContribution,
|
|
5
|
-
CommandRegistry,
|
|
6
|
-
localize,
|
|
7
|
-
IQuickInputService,
|
|
8
|
-
IReporterService,
|
|
9
|
-
getIcon,
|
|
10
|
-
ClientAppContribution,
|
|
11
|
-
} from '@opensumi/ide-core-browser';
|
|
12
|
-
import { MenuContribution, IMenuRegistry, MenuId } from '@opensumi/ide-core-browser/lib/menu/next';
|
|
13
|
-
import { CommandService, CUSTOM_EDITOR_SCHEME, IExtensionProps, URI } from '@opensumi/ide-core-common';
|
|
14
|
-
import {
|
|
15
|
-
BrowserEditorContribution,
|
|
16
|
-
IResource,
|
|
17
|
-
ResourceService,
|
|
18
|
-
WorkbenchEditorService,
|
|
19
|
-
} from '@opensumi/ide-editor/lib/browser';
|
|
20
|
-
import { IFileServiceClient } from '@opensumi/ide-file-service';
|
|
21
|
-
import { FileServiceClient } from '@opensumi/ide-file-service/lib/browser/file-service-client';
|
|
22
|
-
import { IMessageService } from '@opensumi/ide-overlay';
|
|
23
|
-
import { EditorContextKeys } from '@opensumi/monaco-editor-core/esm/vs/editor/common/editorContextKeys';
|
|
24
|
-
import { ContextKeyExpr } from '@opensumi/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
25
|
-
import { DebugProtocol } from '@opensumi/vscode-debugprotocol';
|
|
26
|
-
|
|
27
|
-
import { DEBUG_REPORT_NAME } from '../../../common';
|
|
28
|
-
import { DEBUG_COMMANDS } from '../../debug-contribution';
|
|
29
|
-
import { DebugMemoryFileSystemProvider } from '../../debug-memory';
|
|
30
|
-
import { DebugViewModel } from '../debug-view-model';
|
|
31
|
-
|
|
32
|
-
import {
|
|
33
|
-
CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT,
|
|
34
|
-
CONTEXT_IN_DEBUG_MODE,
|
|
35
|
-
CONTEXT_SET_VARIABLE_SUPPORTED,
|
|
36
|
-
DEBUG_MEMORY_SCHEME,
|
|
37
|
-
CONTEXT_CAN_VIEW_MEMORY,
|
|
38
|
-
} from './../../../common/constants';
|
|
39
|
-
import { DebugWatchModelService } from './../watch/debug-watch-tree.model.service';
|
|
40
|
-
import { DebugVariablesModelService } from './debug-variables-tree.model.service';
|
|
41
|
-
|
|
42
|
-
@Domain(ClientAppContribution, BrowserEditorContribution, MenuContribution, CommandContribution)
|
|
43
|
-
export class VariablesPanelContribution implements BrowserEditorContribution, MenuContribution, CommandContribution {
|
|
44
|
-
@Autowired(IQuickInputService)
|
|
45
|
-
private readonly quickInputService: IQuickInputService;
|
|
46
|
-
|
|
47
|
-
@Autowired(DebugVariablesModelService)
|
|
48
|
-
private readonly debugVariablesModelService: DebugVariablesModelService;
|
|
49
|
-
|
|
50
|
-
@Autowired(DebugWatchModelService)
|
|
51
|
-
private readonly debugWatchModelService: DebugWatchModelService;
|
|
52
|
-
|
|
53
|
-
@Autowired(WorkbenchEditorService)
|
|
54
|
-
protected readonly workbenchEditorService: WorkbenchEditorService;
|
|
55
|
-
|
|
56
|
-
@Autowired(IMessageService)
|
|
57
|
-
private readonly messageService: IMessageService;
|
|
58
|
-
|
|
59
|
-
@Autowired(IReporterService)
|
|
60
|
-
private readonly reporterService: IReporterService;
|
|
61
|
-
|
|
62
|
-
@Autowired(CommandService)
|
|
63
|
-
private readonly commandService: CommandService;
|
|
64
|
-
|
|
65
|
-
@Autowired(DebugViewModel)
|
|
66
|
-
private readonly viewModel: DebugViewModel;
|
|
67
|
-
|
|
68
|
-
@Autowired(IFileServiceClient)
|
|
69
|
-
protected readonly fileSystem: FileServiceClient;
|
|
70
|
-
|
|
71
|
-
@Autowired(DebugMemoryFileSystemProvider)
|
|
72
|
-
private readonly debugMemoryFileSystemProvider: DebugMemoryFileSystemProvider;
|
|
73
|
-
|
|
74
|
-
registerCommands(registry: CommandRegistry) {
|
|
75
|
-
registry.registerCommand(DEBUG_COMMANDS.SET_VARIABLE_VALUE, {
|
|
76
|
-
execute: async () => {
|
|
77
|
-
this.reporterService.point(DEBUG_REPORT_NAME?.DEBUG_VARIABLES, DEBUG_COMMANDS.SET_VARIABLE_VALUE.id);
|
|
78
|
-
const { currentVariableInternalContext: node } = this.debugVariablesModelService;
|
|
79
|
-
if (!node) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const param = await this.quickInputService.open({
|
|
84
|
-
placeHolder: localize('debugger.menu.setValue.param'),
|
|
85
|
-
value: node.description.replace(/^\"(.*)\"$/, '$1') as string,
|
|
86
|
-
});
|
|
87
|
-
if (param !== undefined && param !== null) {
|
|
88
|
-
// 设置值
|
|
89
|
-
try {
|
|
90
|
-
await node.setValue(param);
|
|
91
|
-
} catch (e) {
|
|
92
|
-
this.messageService.error(e.message);
|
|
93
|
-
}
|
|
94
|
-
this.debugVariablesModelService.treeModel?.dispatchChange();
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
registry.registerCommand(DEBUG_COMMANDS.COPY_VARIABLE_VALUE, {
|
|
99
|
-
execute: async () => {
|
|
100
|
-
const { currentVariableInternalContext: node } = this.debugVariablesModelService;
|
|
101
|
-
this.debugVariablesModelService.copyValue(node);
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
registry.registerCommand(DEBUG_COMMANDS.COPY_EVALUATE_PATH, {
|
|
105
|
-
execute: async () => {
|
|
106
|
-
const { currentVariableInternalContext: node } = this.debugVariablesModelService;
|
|
107
|
-
this.debugVariablesModelService.copyEvaluateName(node);
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
registry.registerCommand(DEBUG_COMMANDS.ADD_TO_WATCH_ID, {
|
|
111
|
-
execute: async (node: DebugProtocol.Variable | URI) => {
|
|
112
|
-
const { currentVariableInternalContext } = this.debugVariablesModelService;
|
|
113
|
-
|
|
114
|
-
if (node instanceof URI) {
|
|
115
|
-
// 说明是从编辑器的选中区域来监听表达式
|
|
116
|
-
const currentEditor = this.workbenchEditorService.currentEditor;
|
|
117
|
-
|
|
118
|
-
if (!currentEditor?.monacoEditor) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (!currentEditor?.monacoEditor.hasModel()) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const editor = currentEditor.monacoEditor;
|
|
127
|
-
const text = editor.getModel().getValueInRange(editor.getSelection());
|
|
128
|
-
|
|
129
|
-
this.debugWatchModelService.addWatchExpression(text);
|
|
130
|
-
return;
|
|
131
|
-
} else if (currentVariableInternalContext) {
|
|
132
|
-
this.debugWatchModelService.addWatchExpression(currentVariableInternalContext.evaluateName);
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
const HEX_EDITOR_EXTENSION_ID = 'ms-vscode.hexeditor';
|
|
138
|
-
const HEX_EDITOR_EDITOR_ID = `${CUSTOM_EDITOR_SCHEME}-hexEditor.hexedit`;
|
|
139
|
-
|
|
140
|
-
registry.registerCommand(DEBUG_COMMANDS.VIEW_MEMORY_ID, {
|
|
141
|
-
execute: async (node: DebugProtocol.Variable) => {
|
|
142
|
-
const ext = await this.commandService.executeCommand<IExtensionProps>(
|
|
143
|
-
'extension.getDescription',
|
|
144
|
-
HEX_EDITOR_EXTENSION_ID,
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
if (ext && ext.enabled) {
|
|
148
|
-
const sessionId = this.viewModel.currentSession?.id;
|
|
149
|
-
const memoryReference = node.memoryReference;
|
|
150
|
-
this.workbenchEditorService.open(
|
|
151
|
-
URI.from({
|
|
152
|
-
scheme: DEBUG_MEMORY_SCHEME,
|
|
153
|
-
authority: sessionId,
|
|
154
|
-
path: '/' + encodeURIComponent(memoryReference || '') + '/memory.bin',
|
|
155
|
-
}),
|
|
156
|
-
{
|
|
157
|
-
disableNavigate: true,
|
|
158
|
-
preview: true,
|
|
159
|
-
forceOpenType: {
|
|
160
|
-
type: 'component',
|
|
161
|
-
componentId: HEX_EDITOR_EDITOR_ID,
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
);
|
|
165
|
-
} else {
|
|
166
|
-
this.messageService.warning(localize('debug.variables.view.memory.prompt.hexEditor.notInstalled'));
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
async initialize() {
|
|
173
|
-
this.fileSystem.registerProvider(DEBUG_MEMORY_SCHEME, this.debugMemoryFileSystemProvider);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
registerResource(service: ResourceService) {
|
|
177
|
-
service.registerResourceProvider({
|
|
178
|
-
scheme: DEBUG_MEMORY_SCHEME,
|
|
179
|
-
provideResource: async (uri: URI): Promise<IResource<Partial<{ [prop: string]: any }>>> => ({
|
|
180
|
-
uri,
|
|
181
|
-
icon: getIcon('hex'),
|
|
182
|
-
name: uri.displayName,
|
|
183
|
-
}),
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
registerMenus(registry: IMenuRegistry) {
|
|
188
|
-
registry.registerMenuItem(MenuId.DebugVariablesContext, {
|
|
189
|
-
command: {
|
|
190
|
-
id: DEBUG_COMMANDS.SET_VARIABLE_VALUE.id,
|
|
191
|
-
label: localize('debugger.menu.setValue'),
|
|
192
|
-
},
|
|
193
|
-
order: 10,
|
|
194
|
-
when: CONTEXT_SET_VARIABLE_SUPPORTED.raw,
|
|
195
|
-
group: '3_modification',
|
|
196
|
-
});
|
|
197
|
-
registry.registerMenuItem(MenuId.DebugVariablesContext, {
|
|
198
|
-
command: {
|
|
199
|
-
id: DEBUG_COMMANDS.COPY_VARIABLE_VALUE.id,
|
|
200
|
-
label: localize('debugger.menu.copyValue'),
|
|
201
|
-
},
|
|
202
|
-
order: 10,
|
|
203
|
-
group: '5_cutcopypaste',
|
|
204
|
-
});
|
|
205
|
-
registry.registerMenuItem(MenuId.DebugVariablesContext, {
|
|
206
|
-
command: {
|
|
207
|
-
id: DEBUG_COMMANDS.COPY_EVALUATE_PATH.id,
|
|
208
|
-
label: localize('debugger.menu.copyEvaluatePath'),
|
|
209
|
-
},
|
|
210
|
-
when: CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT.raw,
|
|
211
|
-
order: 20,
|
|
212
|
-
group: '5_cutcopypaste',
|
|
213
|
-
});
|
|
214
|
-
registry.registerMenuItem(MenuId.DebugVariablesContext, {
|
|
215
|
-
command: {
|
|
216
|
-
id: DEBUG_COMMANDS.ADD_TO_WATCH_ID.id,
|
|
217
|
-
label: localize('debugger.menu.addToWatchExpressions'),
|
|
218
|
-
},
|
|
219
|
-
when: CONTEXT_VARIABLE_EVALUATE_NAME_PRESENT.raw,
|
|
220
|
-
order: 100,
|
|
221
|
-
group: 'z_commands',
|
|
222
|
-
});
|
|
223
|
-
registry.registerMenuItem(MenuId.EditorContext, {
|
|
224
|
-
command: {
|
|
225
|
-
id: DEBUG_COMMANDS.ADD_TO_WATCH_ID.id,
|
|
226
|
-
label: localize('debugger.menu.addToWatchExpressions'),
|
|
227
|
-
},
|
|
228
|
-
when: ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, EditorContextKeys.editorTextFocus)
|
|
229
|
-
?.keys()
|
|
230
|
-
.reduce((p, c) => p + ' && ' + c, CONTEXT_IN_DEBUG_MODE.raw),
|
|
231
|
-
group: 'debug',
|
|
232
|
-
order: 1,
|
|
233
|
-
});
|
|
234
|
-
registry.registerMenuItem(MenuId.DebugVariablesContext, {
|
|
235
|
-
command: {
|
|
236
|
-
id: DEBUG_COMMANDS.VIEW_MEMORY_ID.id,
|
|
237
|
-
label: localize('debug.variables.view.memory'),
|
|
238
|
-
},
|
|
239
|
-
iconClass: '',
|
|
240
|
-
when: `${CONTEXT_CAN_VIEW_MEMORY.equalsTo(true)} && ${CONTEXT_IN_DEBUG_MODE.equalsTo(true)}`,
|
|
241
|
-
type: 'icon',
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|