@opensumi/ide-debug 2.21.7-rc-1670246007.0 → 2.21.7
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/debug-session.d.ts.map +1 -1
- package/lib/browser/debug-session.js +1 -5
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +9 -2
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/preferences/launch-folder-preference-provider.d.ts +2 -2
- package/lib/browser/preferences/launch-folder-preference-provider.d.ts.map +1 -1
- package/lib/browser/preferences/launch-folder-preference-provider.js +2 -2
- package/lib/browser/preferences/launch-folder-preference-provider.js.map +1 -1
- 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 -2
- 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 -2
- 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 -2
- 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 +24 -25
- 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 -1182
- 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 -121
- 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 -373
- 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 -244
- 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 -149
- 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 -189
- 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,167 +0,0 @@
|
|
|
1
|
-
import { Autowired } from '@opensumi/di';
|
|
2
|
-
import {
|
|
3
|
-
Domain,
|
|
4
|
-
CommandContribution,
|
|
5
|
-
CommandRegistry,
|
|
6
|
-
TabBarToolbarContribution,
|
|
7
|
-
localize,
|
|
8
|
-
ToolbarRegistry,
|
|
9
|
-
ClientAppContribution,
|
|
10
|
-
KeybindingContribution,
|
|
11
|
-
KeybindingRegistry,
|
|
12
|
-
} from '@opensumi/ide-core-browser';
|
|
13
|
-
import { MenuContribution } from '@opensumi/ide-core-browser/lib/menu/next';
|
|
14
|
-
import { MenuId, IMenuRegistry } from '@opensumi/ide-core-browser/lib/menu/next';
|
|
15
|
-
|
|
16
|
-
import { DEBUG_WATCH_ID } from '../../../common';
|
|
17
|
-
import { DEBUG_COMMANDS } from '../../debug-contribution';
|
|
18
|
-
import { DebugWatchNode } from '../../tree/debug-tree-node.define';
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
CONTEXT_IN_DEBUG_MODE,
|
|
22
|
-
CONTEXT_WATCH_EXPRESSIONS_FOCUSED,
|
|
23
|
-
CONTEXT_WATCH_ITEM_TYPE,
|
|
24
|
-
} from './../../../common/constants';
|
|
25
|
-
import { DebugWatchModelService } from './debug-watch-tree.model.service';
|
|
26
|
-
|
|
27
|
-
@Domain(ClientAppContribution, MenuContribution, CommandContribution, TabBarToolbarContribution, KeybindingContribution)
|
|
28
|
-
export class WatchPanelContribution
|
|
29
|
-
implements
|
|
30
|
-
ClientAppContribution,
|
|
31
|
-
MenuContribution,
|
|
32
|
-
CommandContribution,
|
|
33
|
-
TabBarToolbarContribution,
|
|
34
|
-
KeybindingContribution
|
|
35
|
-
{
|
|
36
|
-
@Autowired(DebugWatchModelService)
|
|
37
|
-
private readonly debugWatchModelService: DebugWatchModelService;
|
|
38
|
-
|
|
39
|
-
registerCommands(registry: CommandRegistry) {
|
|
40
|
-
registry.registerCommand(DEBUG_COMMANDS.ADD_WATCHER, {
|
|
41
|
-
execute: () => {
|
|
42
|
-
this.debugWatchModelService.newDebugWatchNodePrompt();
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
registry.registerCommand(DEBUG_COMMANDS.COLLAPSE_ALL_WATCHER, {
|
|
46
|
-
execute: () => {
|
|
47
|
-
this.debugWatchModelService.collapsedAll();
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
registry.registerCommand(DEBUG_COMMANDS.REMOVE_ALL_WATCHER, {
|
|
51
|
-
execute: () => {
|
|
52
|
-
this.debugWatchModelService.clearAllExpression();
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
registry.registerCommand(DEBUG_COMMANDS.REMOVE_WATCHER, {
|
|
56
|
-
execute: (node: DebugWatchNode | unknown) => {
|
|
57
|
-
if (node instanceof DebugWatchNode) {
|
|
58
|
-
this.debugWatchModelService.removeDebugWatchNode(node);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const [selectedNode] = this.debugWatchModelService.selectedNodes;
|
|
62
|
-
if (selectedNode instanceof DebugWatchNode) {
|
|
63
|
-
this.debugWatchModelService.removeDebugWatchNode(selectedNode);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
registry.registerCommand(DEBUG_COMMANDS.EDIT_WATCHER, {
|
|
68
|
-
execute: (node: DebugWatchNode) => {
|
|
69
|
-
this.debugWatchModelService.renameDebugWatchNodePrompt(node);
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
registry.registerCommand(DEBUG_COMMANDS.COPY_WATCHER_VALUE, {
|
|
73
|
-
execute: (node: DebugWatchNode) => {
|
|
74
|
-
this.debugWatchModelService.copyValue(node);
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
registerToolbarItems(registry: ToolbarRegistry) {
|
|
80
|
-
/**
|
|
81
|
-
* Watch 面板菜单
|
|
82
|
-
*/
|
|
83
|
-
registry.registerItem({
|
|
84
|
-
id: DEBUG_COMMANDS.REMOVE_ALL_WATCHER.id,
|
|
85
|
-
command: DEBUG_COMMANDS.REMOVE_ALL_WATCHER.id,
|
|
86
|
-
viewId: DEBUG_WATCH_ID,
|
|
87
|
-
tooltip: localize('debug.watch.removeAll'),
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
registry.registerItem({
|
|
91
|
-
id: DEBUG_COMMANDS.COLLAPSE_ALL_WATCHER.id,
|
|
92
|
-
command: DEBUG_COMMANDS.COLLAPSE_ALL_WATCHER.id,
|
|
93
|
-
viewId: DEBUG_WATCH_ID,
|
|
94
|
-
tooltip: localize('debug.watch.collapseAll'),
|
|
95
|
-
when: CONTEXT_IN_DEBUG_MODE.raw,
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
registry.registerItem({
|
|
99
|
-
id: DEBUG_COMMANDS.ADD_WATCHER.id,
|
|
100
|
-
command: DEBUG_COMMANDS.ADD_WATCHER.id,
|
|
101
|
-
viewId: DEBUG_WATCH_ID,
|
|
102
|
-
tooltip: localize('debug.watch.add'),
|
|
103
|
-
when: CONTEXT_IN_DEBUG_MODE.raw,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
registerMenus(registry: IMenuRegistry) {
|
|
108
|
-
registry.registerMenuItem(MenuId.DebugWatchContext, {
|
|
109
|
-
command: {
|
|
110
|
-
id: DEBUG_COMMANDS.ADD_WATCHER.id,
|
|
111
|
-
label: localize('debug.watch.add'),
|
|
112
|
-
},
|
|
113
|
-
order: 10,
|
|
114
|
-
group: '3_modification',
|
|
115
|
-
});
|
|
116
|
-
registry.registerMenuItem(MenuId.DebugWatchContext, {
|
|
117
|
-
command: {
|
|
118
|
-
id: DEBUG_COMMANDS.EDIT_WATCHER.id,
|
|
119
|
-
label: localize('debug.watch.edit'),
|
|
120
|
-
},
|
|
121
|
-
when: CONTEXT_WATCH_ITEM_TYPE.equalsTo('expression'),
|
|
122
|
-
order: 20,
|
|
123
|
-
group: '3_modification',
|
|
124
|
-
});
|
|
125
|
-
registry.registerMenuItem(MenuId.DebugWatchContext, {
|
|
126
|
-
command: {
|
|
127
|
-
id: DEBUG_COMMANDS.COPY_WATCHER_VALUE.id,
|
|
128
|
-
label: localize('debug.watch.copyValue'),
|
|
129
|
-
},
|
|
130
|
-
when: `${CONTEXT_WATCH_ITEM_TYPE.equalsTo('expression')} || ${CONTEXT_WATCH_ITEM_TYPE.equalsTo('variable')} && ${
|
|
131
|
-
CONTEXT_IN_DEBUG_MODE.raw
|
|
132
|
-
}`,
|
|
133
|
-
order: 30,
|
|
134
|
-
enabledWhen: CONTEXT_IN_DEBUG_MODE.raw,
|
|
135
|
-
group: '3_modification',
|
|
136
|
-
});
|
|
137
|
-
registry.registerMenuItem(MenuId.DebugWatchContext, {
|
|
138
|
-
command: {
|
|
139
|
-
id: DEBUG_COMMANDS.REMOVE_WATCHER.id,
|
|
140
|
-
label: localize('debug.watch.remove'),
|
|
141
|
-
},
|
|
142
|
-
when: CONTEXT_WATCH_ITEM_TYPE.equalsTo('expression'),
|
|
143
|
-
order: 10,
|
|
144
|
-
group: 'z_commands',
|
|
145
|
-
});
|
|
146
|
-
registry.registerMenuItem(MenuId.DebugWatchContext, {
|
|
147
|
-
command: {
|
|
148
|
-
id: DEBUG_COMMANDS.REMOVE_ALL_WATCHER.id,
|
|
149
|
-
label: localize('debug.watch.removeAll'),
|
|
150
|
-
},
|
|
151
|
-
order: 20,
|
|
152
|
-
group: 'z_commands',
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
registerKeybindings(keybindings: KeybindingRegistry) {
|
|
157
|
-
keybindings.registerKeybinding({
|
|
158
|
-
command: DEBUG_COMMANDS.REMOVE_WATCHER.id,
|
|
159
|
-
keybinding: 'ctrlcmd+backspace',
|
|
160
|
-
when: CONTEXT_WATCH_EXPRESSIONS_FOCUSED.raw,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
onStart() {
|
|
165
|
-
this.debugWatchModelService.load();
|
|
166
|
-
}
|
|
167
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
@import '~@opensumi/ide-core-browser/lib/style/variable.less';
|
|
2
|
-
|
|
3
|
-
.debug_watch_node {
|
|
4
|
-
height: 22px;
|
|
5
|
-
line-height: 22px;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
position: relative;
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
user-select: none;
|
|
11
|
-
|
|
12
|
-
&:hover {
|
|
13
|
-
color: var(--kt-tree-hoverForeground);
|
|
14
|
-
background: var(--kt-tree-hoverBackground);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.debug_watch_node_prompt_box {
|
|
18
|
-
:global(input) {
|
|
19
|
-
&.validate-error {
|
|
20
|
-
color: var(--inputValidation-errorForeground);
|
|
21
|
-
background-color: var(--inputValidation-errorBackground);
|
|
22
|
-
border: 1px solid var(--inputValidation-errorBorder);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.validate-info {
|
|
26
|
-
background-color: var(--inputValidation-infoBackground);
|
|
27
|
-
border: 1px solid var(--inputValidation-infoBorder);
|
|
28
|
-
color: var(--inputValidation-infoForeground);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.validate-warning {
|
|
32
|
-
background-color: var(--inputValidation-warningBackground);
|
|
33
|
-
border: 1px solid var(--inputValidation-warningBorder);
|
|
34
|
-
color: var(--inputValidation-warningForeground);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.mod_selected {
|
|
40
|
-
color: var(--kt-tree-inactiveSelectionForeground) !important;
|
|
41
|
-
background: var(--kt-tree-inactiveSelectionBackground);
|
|
42
|
-
.expansion_toggle {
|
|
43
|
-
color: var(--kt-tree-inactiveSelectionForeground) !important;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.mod_focused {
|
|
48
|
-
outline: 1px solid var(--list-focusOutline);
|
|
49
|
-
outline-offset: -1px;
|
|
50
|
-
color: var(--kt-tree-activeSelectionForeground) !important;
|
|
51
|
-
background: var(--kt-tree-activeSelectionBackground);
|
|
52
|
-
.expansion_toggle {
|
|
53
|
-
color: var(--kt-tree-activeSelectionForeground) !important;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&.mod_actived {
|
|
58
|
-
outline: 1px solid var(--list-focusOutline);
|
|
59
|
-
outline-offset: -1px;
|
|
60
|
-
.expansion_toggle {
|
|
61
|
-
color: var(--kt-tree-activeSelectionForeground) !important;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.mod_loading {
|
|
66
|
-
opacity: 0.8;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.debug_watch_node_content {
|
|
71
|
-
position: relative;
|
|
72
|
-
display: flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
width: 100%;
|
|
75
|
-
user-select: text;
|
|
76
|
-
match {
|
|
77
|
-
background-color: var(--editor-findMatchHighlightBackground);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.debug_watch_node_inputbox {
|
|
82
|
-
display: inline-block;
|
|
83
|
-
width: 100%;
|
|
84
|
-
input {
|
|
85
|
-
font-size: @base-font-size;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.debug_watch_node_status {
|
|
90
|
-
opacity: 0.75;
|
|
91
|
-
text-align: center;
|
|
92
|
-
font-size: 12px;
|
|
93
|
-
padding-right: 0;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.debug_watch_node_segment {
|
|
97
|
-
flex-grow: 0;
|
|
98
|
-
white-space: nowrap;
|
|
99
|
-
color: inherit;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.debug_watch_node_displayname {
|
|
103
|
-
margin-right: 6px;
|
|
104
|
-
display: inline;
|
|
105
|
-
white-space: pre;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.debug_watch_node_description {
|
|
109
|
-
display: inline;
|
|
110
|
-
transform: scale(0.96);
|
|
111
|
-
color: var(--descriptionForeground);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.debug_watch_node_overflow_wrap {
|
|
115
|
-
flex: 1;
|
|
116
|
-
flex-shrink: 0;
|
|
117
|
-
overflow: hidden;
|
|
118
|
-
text-overflow: ellipsis;
|
|
119
|
-
white-space: nowrap;
|
|
120
|
-
text-align: left;
|
|
121
|
-
color: var(--foreground);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.debug_watch_node_prompt_wrap {
|
|
125
|
-
flex: 1;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.expansion_toggle {
|
|
129
|
-
min-width: 20px;
|
|
130
|
-
display: flex;
|
|
131
|
-
justify-content: center;
|
|
132
|
-
flex-shrink: 0;
|
|
133
|
-
font-size: 16px;
|
|
134
|
-
color: var(--foreground);
|
|
135
|
-
position: absolute;
|
|
136
|
-
left: -20px;
|
|
137
|
-
&.mod_collapsed {
|
|
138
|
-
&:before {
|
|
139
|
-
display: block;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&:not(.mod_collapsed) {
|
|
144
|
-
&:before {
|
|
145
|
-
display: block;
|
|
146
|
-
transform: rotate(90deg);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.debug_watch_node_tail {
|
|
152
|
-
text-align: center;
|
|
153
|
-
margin-right: 10px;
|
|
154
|
-
position: relative;
|
|
155
|
-
height: 22px;
|
|
156
|
-
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// variable
|
|
161
|
-
.debug_watch_variable {
|
|
162
|
-
white-space: nowrap;
|
|
163
|
-
overflow: hidden;
|
|
164
|
-
text-overflow: ellipsis;
|
|
165
|
-
overflow: visible;
|
|
166
|
-
&.value {
|
|
167
|
-
color: var(--debugTokenExpression-value);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
&.name {
|
|
171
|
-
color: var(--debugTokenExpression-name);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
&.error {
|
|
175
|
-
color: var(--debugTokenExpression-error);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
&.number {
|
|
179
|
-
color: var(--debugTokenExpression-number);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&.boolean {
|
|
183
|
-
color: var(--debugTokenExpression-boolean);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
&.string {
|
|
187
|
-
color: var(--debugTokenExpression-string);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import cls from 'classnames';
|
|
2
|
-
import { observer } from 'mobx-react-lite';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
INodeRendererProps,
|
|
7
|
-
ClasslistComposite,
|
|
8
|
-
IRecycleTreeHandle,
|
|
9
|
-
TreeNodeType,
|
|
10
|
-
RecycleTree,
|
|
11
|
-
INodeRendererWrapProps,
|
|
12
|
-
TreeModel,
|
|
13
|
-
PromptHandle,
|
|
14
|
-
} from '@opensumi/ide-components';
|
|
15
|
-
import { Loading } from '@opensumi/ide-components';
|
|
16
|
-
import { useInjectable, getIcon, DisposableCollection, Disposable } from '@opensumi/ide-core-browser';
|
|
17
|
-
import { ViewState } from '@opensumi/ide-core-browser';
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
ExpressionContainer,
|
|
21
|
-
ExpressionNode,
|
|
22
|
-
DebugVariableContainer,
|
|
23
|
-
DebugVariable,
|
|
24
|
-
DebugWatchNode,
|
|
25
|
-
} from '../../tree/debug-tree-node.define';
|
|
26
|
-
|
|
27
|
-
import { DebugWatchModelService, IWatchNode } from './debug-watch-tree.model.service';
|
|
28
|
-
import styles from './debug-watch.module.less';
|
|
29
|
-
|
|
30
|
-
export const DEBUG_WATCH_TREE_FIELD_NAME = 'DEBUG_WATCH_TREE_FIELD';
|
|
31
|
-
|
|
32
|
-
export const DebugWatchView = observer(({ viewState }: React.PropsWithChildren<{ viewState: ViewState }>) => {
|
|
33
|
-
const DEBUG_VARIABLE_ITEM_HEIGHT = 22;
|
|
34
|
-
|
|
35
|
-
const { height } = viewState;
|
|
36
|
-
|
|
37
|
-
const wrapperRef: React.RefObject<HTMLDivElement> = React.createRef();
|
|
38
|
-
const [model, setModel] = React.useState<TreeModel>();
|
|
39
|
-
|
|
40
|
-
const debugWatchModelService = useInjectable<DebugWatchModelService>(DebugWatchModelService);
|
|
41
|
-
|
|
42
|
-
React.useEffect(() => initTreeModel(), []);
|
|
43
|
-
|
|
44
|
-
const initTreeModel = () => {
|
|
45
|
-
const treeModel = debugWatchModelService.treeModel;
|
|
46
|
-
let shouldUpdate = true;
|
|
47
|
-
const disposableCollection = new DisposableCollection();
|
|
48
|
-
disposableCollection.push(
|
|
49
|
-
Disposable.create(() => {
|
|
50
|
-
shouldUpdate = false;
|
|
51
|
-
}),
|
|
52
|
-
);
|
|
53
|
-
if (treeModel) {
|
|
54
|
-
treeModel.ensureReady.then(() => {
|
|
55
|
-
if (shouldUpdate) {
|
|
56
|
-
setModel(treeModel);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
disposableCollection.push(
|
|
61
|
-
debugWatchModelService.onDidUpdateTreeModel(async (model: TreeModel) => {
|
|
62
|
-
if (model) {
|
|
63
|
-
await model.ensureReady;
|
|
64
|
-
}
|
|
65
|
-
if (shouldUpdate) {
|
|
66
|
-
setModel(model);
|
|
67
|
-
}
|
|
68
|
-
}),
|
|
69
|
-
);
|
|
70
|
-
return () => {
|
|
71
|
-
debugWatchModelService.removeNodeDecoration();
|
|
72
|
-
disposableCollection.dispose();
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const handleTreeReady = (handle: IRecycleTreeHandle) => {
|
|
77
|
-
debugWatchModelService.handleTreeHandler({
|
|
78
|
-
...handle,
|
|
79
|
-
getModel: () => model!,
|
|
80
|
-
hasDirectFocus: () => wrapperRef.current === document.activeElement,
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const handleTwistierClick = (ev: React.MouseEvent, item: IWatchNode, type: TreeNodeType) => {
|
|
85
|
-
// 阻止点击事件冒泡
|
|
86
|
-
ev.stopPropagation();
|
|
87
|
-
|
|
88
|
-
const { handleTwistierClick } = debugWatchModelService;
|
|
89
|
-
if (!item) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
handleTwistierClick(item, type);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const handlerContextMenu = (ev: React.MouseEvent, node: IWatchNode) => {
|
|
96
|
-
const { handleContextMenu } = debugWatchModelService;
|
|
97
|
-
handleContextMenu(ev, node);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const handleOuterContextMenu = (ev: React.MouseEvent) => {
|
|
101
|
-
const { handleContextMenu } = debugWatchModelService;
|
|
102
|
-
handleContextMenu(ev);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const handleOuterClick = (ev: React.MouseEvent) => {
|
|
106
|
-
// 空白区域点击,取消焦点状态
|
|
107
|
-
const { enactiveNodeDecoration } = debugWatchModelService;
|
|
108
|
-
enactiveNodeDecoration();
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const handleOuterBlur = (ev: React.FocusEvent) => {
|
|
112
|
-
// 空白区域点击,取消焦点状态
|
|
113
|
-
const { enactiveNodeDecoration } = debugWatchModelService;
|
|
114
|
-
enactiveNodeDecoration();
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const renderWatchNode = React.useCallback(
|
|
118
|
-
(props: INodeRendererWrapProps) => {
|
|
119
|
-
const decorations = debugWatchModelService.decorations.getDecorations(props.item as any);
|
|
120
|
-
return (
|
|
121
|
-
<DebugWatchRenderedNode
|
|
122
|
-
item={props.item}
|
|
123
|
-
itemType={props.itemType}
|
|
124
|
-
decorations={decorations}
|
|
125
|
-
onClick={handleTwistierClick}
|
|
126
|
-
onTwistierClick={handleTwistierClick}
|
|
127
|
-
onContextMenu={handlerContextMenu}
|
|
128
|
-
defaultLeftPadding={12}
|
|
129
|
-
leftPadding={8}
|
|
130
|
-
/>
|
|
131
|
-
);
|
|
132
|
-
},
|
|
133
|
-
[model],
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
const renderContent = () => {
|
|
137
|
-
if (!model) {
|
|
138
|
-
return <span />;
|
|
139
|
-
} else {
|
|
140
|
-
return (
|
|
141
|
-
<RecycleTree
|
|
142
|
-
height={height}
|
|
143
|
-
itemHeight={DEBUG_VARIABLE_ITEM_HEIGHT}
|
|
144
|
-
onReady={handleTreeReady}
|
|
145
|
-
model={model!}
|
|
146
|
-
placeholder={() => <span />}
|
|
147
|
-
>
|
|
148
|
-
{renderWatchNode}
|
|
149
|
-
</RecycleTree>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<div
|
|
156
|
-
className={styles.debug_watch_container}
|
|
157
|
-
tabIndex={-1}
|
|
158
|
-
ref={wrapperRef}
|
|
159
|
-
onContextMenu={handleOuterContextMenu}
|
|
160
|
-
onClick={handleOuterClick}
|
|
161
|
-
onBlur={handleOuterBlur}
|
|
162
|
-
data-name={DEBUG_WATCH_TREE_FIELD_NAME}
|
|
163
|
-
>
|
|
164
|
-
{renderContent()}
|
|
165
|
-
</div>
|
|
166
|
-
);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
export interface IDebugVariableNodeProps {
|
|
170
|
-
item: any;
|
|
171
|
-
defaultLeftPadding?: number;
|
|
172
|
-
leftPadding?: number;
|
|
173
|
-
decorations?: ClasslistComposite;
|
|
174
|
-
onClick: (ev: React.MouseEvent, item: ExpressionNode | ExpressionContainer, type: TreeNodeType) => void;
|
|
175
|
-
onTwistierClick: (ev: React.MouseEvent, item: ExpressionNode | ExpressionContainer, type: TreeNodeType) => void;
|
|
176
|
-
onContextMenu?: (ev: React.MouseEvent, item: ExpressionNode | ExpressionContainer, type: TreeNodeType) => void;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export type IDebugWatchNodeRenderedProps = IDebugVariableNodeProps & INodeRendererProps;
|
|
180
|
-
|
|
181
|
-
export const DebugWatchRenderedNode: React.FC<IDebugWatchNodeRenderedProps> = ({
|
|
182
|
-
item,
|
|
183
|
-
decorations,
|
|
184
|
-
defaultLeftPadding,
|
|
185
|
-
leftPadding,
|
|
186
|
-
onClick,
|
|
187
|
-
onTwistierClick,
|
|
188
|
-
onContextMenu,
|
|
189
|
-
itemType,
|
|
190
|
-
}: IDebugWatchNodeRenderedProps) => {
|
|
191
|
-
const isRenamePrompt = itemType === TreeNodeType.RenamePrompt;
|
|
192
|
-
const isNewPrompt = itemType === TreeNodeType.NewPrompt;
|
|
193
|
-
const isPrompt = isRenamePrompt || isNewPrompt;
|
|
194
|
-
|
|
195
|
-
const handleClick = (ev: React.MouseEvent) => {
|
|
196
|
-
const watch = (item as DebugWatchNode).getRawWatch();
|
|
197
|
-
if (watch) {
|
|
198
|
-
onClick(ev, item, watch.variablesReference > 0 ? TreeNodeType.CompositeTreeNode : TreeNodeType.TreeNode);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
const handleContextMenu = (ev: React.MouseEvent) => {
|
|
203
|
-
if (ev.nativeEvent.which === 0) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
if (itemType === TreeNodeType.TreeNode || itemType === TreeNodeType.CompositeTreeNode) {
|
|
207
|
-
onContextMenu && onContextMenu(ev, item as ExpressionNode, itemType);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const editorNodeStyle = {
|
|
212
|
-
height: DEBUG_WATCH_TREE_NODE_HEIGHT,
|
|
213
|
-
lineHeight: `${DEBUG_WATCH_TREE_NODE_HEIGHT}px`,
|
|
214
|
-
paddingLeft: `${(defaultLeftPadding || 8) + (item.depth || 0) * (leftPadding || 0)}px`,
|
|
215
|
-
} as React.CSSProperties;
|
|
216
|
-
|
|
217
|
-
const renderDisplayName = (node: ExpressionContainer | ExpressionNode) => {
|
|
218
|
-
if (isPrompt && node instanceof PromptHandle) {
|
|
219
|
-
return (
|
|
220
|
-
<div className={cls(styles.debug_watch_node_segment, styles.debug_watch_node_inputbox)}>
|
|
221
|
-
<div className={cls('input-box', styles.debug_watch_node_prompt_box)}>
|
|
222
|
-
<node.ProxiedInput wrapperStyle={{ height: DEBUG_WATCH_TREE_NODE_HEIGHT, padding: '0 5px' }} />
|
|
223
|
-
</div>
|
|
224
|
-
</div>
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
return (
|
|
228
|
-
<div
|
|
229
|
-
className={cls(
|
|
230
|
-
styles.debug_watch_node_segment,
|
|
231
|
-
styles.debug_watch_node_displayname,
|
|
232
|
-
styles.debug_watch_variable,
|
|
233
|
-
(node as DebugVariable).description ? styles.name : '',
|
|
234
|
-
)}
|
|
235
|
-
>
|
|
236
|
-
{node.name}
|
|
237
|
-
{(node as DebugVariable).description ? ':' : ''}
|
|
238
|
-
</div>
|
|
239
|
-
);
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
const renderDescription = (node: ExpressionContainer | ExpressionNode) => {
|
|
243
|
-
const booleanRegex = /^true|false$/i;
|
|
244
|
-
const stringRegex = /^(['"]).*\1$/;
|
|
245
|
-
const description = (node as DebugVariableContainer).description
|
|
246
|
-
? (node as DebugVariableContainer).description.replace('function', 'ƒ ')
|
|
247
|
-
: '';
|
|
248
|
-
const addonClass = [styles.debug_watch_variable];
|
|
249
|
-
if (isPrompt) {
|
|
250
|
-
return null;
|
|
251
|
-
}
|
|
252
|
-
if (item.variableType === 'number' || item.variableType === 'boolean' || item.variableType === 'string') {
|
|
253
|
-
addonClass.push(styles[item.variableType]);
|
|
254
|
-
} else if (!isNaN(+description)) {
|
|
255
|
-
addonClass.push(styles.number);
|
|
256
|
-
} else if (booleanRegex.test(description)) {
|
|
257
|
-
addonClass.push(styles.boolean);
|
|
258
|
-
} else if (stringRegex.test(description)) {
|
|
259
|
-
addonClass.push(styles.string);
|
|
260
|
-
}
|
|
261
|
-
return (
|
|
262
|
-
<div className={cls(styles.debug_watch_node_segment_grow, styles.debug_watch_node_description, ...addonClass)}>
|
|
263
|
-
{description}
|
|
264
|
-
</div>
|
|
265
|
-
);
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
const renderStatusTail = () => (
|
|
269
|
-
<div className={cls(styles.debug_watch_node_segment, styles.debug_watch_node_tail)}>{renderBadge()}</div>
|
|
270
|
-
);
|
|
271
|
-
|
|
272
|
-
const renderBadge = () => <div className={styles.debug_watch_node_status}>{item.badge}</div>;
|
|
273
|
-
|
|
274
|
-
const getItemTooltip = () => {
|
|
275
|
-
const tooltip = item.tooltip;
|
|
276
|
-
return tooltip;
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
const renderToggle = (node: ExpressionContainer, clickHandler: any) => {
|
|
280
|
-
const handleTwiceClick = (ev: React.MouseEvent) => {
|
|
281
|
-
clickHandler(ev, node, itemType);
|
|
282
|
-
};
|
|
283
|
-
if (decorations && decorations?.classlist.indexOf(styles.mod_loading) > -1) {
|
|
284
|
-
return (
|
|
285
|
-
<div className={cls(styles.debug_watch_node_segment, styles.expansion_toggle)}>
|
|
286
|
-
<Loading />
|
|
287
|
-
</div>
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
return (
|
|
291
|
-
<div
|
|
292
|
-
onClick={handleTwiceClick}
|
|
293
|
-
className={cls(styles.debug_watch_node_segment, styles.expansion_toggle, getIcon('right'), {
|
|
294
|
-
[`${styles.mod_collapsed}`]: !(node as ExpressionContainer).expanded,
|
|
295
|
-
})}
|
|
296
|
-
/>
|
|
297
|
-
);
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
const renderTwice = (item) => {
|
|
301
|
-
if (DebugWatchNode.is(item)) {
|
|
302
|
-
if ((item as DebugWatchNode).available && (item as DebugWatchNode).variablesReference) {
|
|
303
|
-
return renderToggle(item as ExpressionContainer, onTwistierClick);
|
|
304
|
-
}
|
|
305
|
-
} else if (ExpressionContainer.is(item)) {
|
|
306
|
-
if ((item as ExpressionContainer).variablesReference) {
|
|
307
|
-
return renderToggle(item as ExpressionContainer, onTwistierClick);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
return (
|
|
313
|
-
<div
|
|
314
|
-
key={item.id}
|
|
315
|
-
onClick={handleClick}
|
|
316
|
-
onContextMenu={handleContextMenu}
|
|
317
|
-
title={getItemTooltip()}
|
|
318
|
-
className={cls(styles.debug_watch_node, decorations ? decorations.classlist : null)}
|
|
319
|
-
style={editorNodeStyle}
|
|
320
|
-
data-id={item.id}
|
|
321
|
-
>
|
|
322
|
-
<div className={cls(styles.debug_watch_node_content)}>
|
|
323
|
-
{renderTwice(item)}
|
|
324
|
-
<div
|
|
325
|
-
style={{ height: DEBUG_WATCH_TREE_NODE_HEIGHT }}
|
|
326
|
-
className={isPrompt ? styles.debug_watch_node_prompt_wrap : styles.debug_watch_node_overflow_wrap}
|
|
327
|
-
>
|
|
328
|
-
{renderDisplayName(item)}
|
|
329
|
-
{renderDescription(item)}
|
|
330
|
-
</div>
|
|
331
|
-
{renderStatusTail()}
|
|
332
|
-
</div>
|
|
333
|
-
</div>
|
|
334
|
-
);
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
export const DEBUG_WATCH_TREE_NODE_HEIGHT = 22;
|