@opensumi/ide-debug 2.21.6-rc-1669620508.0 → 2.21.6
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/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 -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 -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 -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 -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,128 +0,0 @@
|
|
|
1
|
-
.sumi-breakpoint-icon-size {
|
|
2
|
-
background-size: 16px 16px;
|
|
3
|
-
cursor: pointer;
|
|
4
|
-
}
|
|
5
|
-
// 全局调试样式
|
|
6
|
-
.sumi-debug-breakpoint {
|
|
7
|
-
background: url('./assets/breakpoint.svg') center center no-repeat;
|
|
8
|
-
.sumi-breakpoint-icon-size;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.sumi-debug-breakpoint-disabled {
|
|
12
|
-
background: url('./assets/breakpoint-disabled.svg') center center no-repeat;
|
|
13
|
-
.sumi-breakpoint-icon-size;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.sumi-debug-breakpoint-unverified {
|
|
17
|
-
background: url('./assets/breakpoint-unverified.svg') center center no-repeat;
|
|
18
|
-
.sumi-breakpoint-icon-size;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.sumi-debug-breakpoint-unsupported {
|
|
22
|
-
background: url('./assets/breakpoint-unsupported.svg') center center no-repeat;
|
|
23
|
-
.sumi-breakpoint-icon-size;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.sumi-debug-conditional-breakpoint {
|
|
27
|
-
background: url('./assets/breakpoint-conditional.svg') center center no-repeat;
|
|
28
|
-
.sumi-breakpoint-icon-size;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.sumi-debug-conditional-breakpoint-disabled {
|
|
32
|
-
background: url('./assets/breakpoint-conditional-disabled.svg') center center no-repeat;
|
|
33
|
-
.sumi-breakpoint-icon-size;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.sumi-debug-conditional-breakpoint-unverified {
|
|
37
|
-
background: url('./assets/breakpoint-conditional-unverified.svg') center center no-repeat;
|
|
38
|
-
.sumi-breakpoint-icon-size;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sumi-debug-logpoint {
|
|
42
|
-
background: url('./assets/breakpoint-log.svg') center center no-repeat;
|
|
43
|
-
.sumi-breakpoint-icon-size;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.sumi-debug-logpoint-disabled {
|
|
47
|
-
background: url('./assets/breakpoint-log-disabled.svg') center center no-repeat;
|
|
48
|
-
.sumi-breakpoint-icon-size;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.sumi-debug-logpoint-unverified {
|
|
52
|
-
background: url('./assets/breakpoint-log-unverified.svg') center center no-repeat;
|
|
53
|
-
.sumi-breakpoint-icon-size;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.monaco-editor .sumi-debug-breakpoint-hint {
|
|
57
|
-
background: url('./assets/breakpoint-hint.svg') center center no-repeat;
|
|
58
|
-
.sumi-breakpoint-icon-size;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.monaco-editor .sumi-debug-top-stack-frame {
|
|
62
|
-
background: url('./assets/current-arrow.svg') center center no-repeat;
|
|
63
|
-
.sumi-breakpoint-icon-size;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.monaco-editor .sumi-debug-top-stack-frame {
|
|
67
|
-
&.sumi-debug-breakpoint,
|
|
68
|
-
&.sumi-debug-conditional-breakpoint,
|
|
69
|
-
&.logpoint {
|
|
70
|
-
background: url('./assets/current-and-breakpoint.svg') center center no-repeat;
|
|
71
|
-
.sumi-breakpoint-icon-size;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.monaco-editor .view-overlays .sumi-debug-top-stack-frame-line {
|
|
76
|
-
background: #ffff6673;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.monaco-editor.vs-dark .view-overlays .sumi-debug-top-stack-frame-line {
|
|
80
|
-
background: #ffff0033;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.monaco-editor .sumi-debug-focused-stack-frame {
|
|
84
|
-
background: url('./assets/stackframe-arrow.svg') center center no-repeat;
|
|
85
|
-
.sumi-breakpoint-icon-size;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.monaco-editor .sumi-debug-focused-stack-frame.sumi-debug-breakpoint {
|
|
89
|
-
background: url('./assets/stackframe-and-breakpoint.svg') center center no-repeat;
|
|
90
|
-
.sumi-breakpoint-icon-size;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.monaco-editor .view-overlays .sumi-debug-focused-stack-frame-line {
|
|
94
|
-
background: #cee7ce73;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.monaco-editor.vs-dark .view-overlays .sumi-debug-focused-stack-frame-line {
|
|
98
|
-
background: #7abd7a4d;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.monaco-editor.vs-dark .view-overlays .sumi-debug-top-stack-frame-exception-line {
|
|
102
|
-
background-color: #6c2022;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.inline-breakpoint-widget.codicon {
|
|
106
|
-
display: flex !important;
|
|
107
|
-
align-items: center;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.inline-breakpoint-widget.codicon-debug-breakpoint-disabled {
|
|
111
|
-
opacity: 0.7;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.monaco-editor .inline-breakpoint-widget.line-start {
|
|
115
|
-
left: -8px !important;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.monaco-editor .inline-breakpoint-widget {
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.monaco-editor .debug-breakpoint-placeholder::before {
|
|
123
|
-
content: ' ';
|
|
124
|
-
width: 0.9em;
|
|
125
|
-
display: inline-flex;
|
|
126
|
-
vertical-align: middle;
|
|
127
|
-
margin-top: -1px;
|
|
128
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { strings } from '@opensumi/ide-core-browser';
|
|
2
|
-
|
|
3
|
-
import { DebugConfiguration } from '../common';
|
|
4
|
-
|
|
5
|
-
const { equalsIgnoreCase } = strings;
|
|
6
|
-
|
|
7
|
-
export function isExtensionHostDebugging(config: DebugConfiguration) {
|
|
8
|
-
return (
|
|
9
|
-
config.type &&
|
|
10
|
-
equalsIgnoreCase(
|
|
11
|
-
config.type === 'vslsShare' ? (config as any).adapterProxy.configuration.type : config.type,
|
|
12
|
-
'extensionhost',
|
|
13
|
-
)
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function matchAll(str: string, regexp: RegExp) {
|
|
18
|
-
let match: RegExpExecArray | null;
|
|
19
|
-
const res: RegExpExecArray[] = [];
|
|
20
|
-
while ((match = regexp.exec(str)) !== null) {
|
|
21
|
-
res.push(match);
|
|
22
|
-
}
|
|
23
|
-
return res;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* request 为 attach 时,排除连接非远程机器 ip 的情况
|
|
28
|
-
*/
|
|
29
|
-
export function isRemoteAttach(config: DebugConfiguration): boolean {
|
|
30
|
-
if (config.request === 'attach') {
|
|
31
|
-
/**
|
|
32
|
-
* key: 调试语言 type
|
|
33
|
-
* value: 不同语言的调试插件在 attach 模式下. 要 attach 上的 TCP/IP 地址所对应的 launch 属性
|
|
34
|
-
*/
|
|
35
|
-
const map = {
|
|
36
|
-
node: 'address',
|
|
37
|
-
java: 'hostName',
|
|
38
|
-
go: 'host',
|
|
39
|
-
cppdbg: 'miDebuggerServerAddress',
|
|
40
|
-
python: 'host',
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const { type } = config;
|
|
44
|
-
const host = config[map[type]];
|
|
45
|
-
|
|
46
|
-
if (host) {
|
|
47
|
-
return !['localhost', '0.0.0.0', '127.0.0.1', '::1'].includes(host);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?';
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Create a word definition regular expression based on default word separators.
|
|
59
|
-
* Optionally provide allowed separators that should be included in words.
|
|
60
|
-
*
|
|
61
|
-
* The default would look like this:
|
|
62
|
-
* /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
|
|
63
|
-
*/
|
|
64
|
-
function createWordRegExp(allowInWords = ''): RegExp {
|
|
65
|
-
let source = '(-?\\d*\\.\\d\\w*)|([^';
|
|
66
|
-
for (const sep of USUAL_WORD_SEPARATORS) {
|
|
67
|
-
if (allowInWords.indexOf(sep) >= 0) {
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
source += '\\' + sep;
|
|
71
|
-
}
|
|
72
|
-
source += '\\s]+)';
|
|
73
|
-
return new RegExp(source, 'g');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// catches numbers (including floating numbers) in the first group, and alphanum in the second
|
|
77
|
-
export const DEFAULT_WORD_REGEXP = createWordRegExp();
|
|
78
|
-
|
|
79
|
-
export class CharWidthReader {
|
|
80
|
-
private static _INSTANCE: CharWidthReader | null = null;
|
|
81
|
-
|
|
82
|
-
public static getInstance(): CharWidthReader {
|
|
83
|
-
if (!CharWidthReader._INSTANCE) {
|
|
84
|
-
CharWidthReader._INSTANCE = new CharWidthReader();
|
|
85
|
-
}
|
|
86
|
-
return CharWidthReader._INSTANCE;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
private readonly _cache: Map<string, number>;
|
|
90
|
-
private readonly _canvas: HTMLCanvasElement;
|
|
91
|
-
|
|
92
|
-
private constructor() {
|
|
93
|
-
this._cache = new Map();
|
|
94
|
-
this._canvas = document.createElement('canvas');
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public getCharWidth(char: string, font: string): number {
|
|
98
|
-
const cacheKey = char + font;
|
|
99
|
-
if (this._cache.has(cacheKey)) {
|
|
100
|
-
return this._cache.get(cacheKey)!;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const context = this._canvas.getContext('2d')!;
|
|
104
|
-
context.font = font;
|
|
105
|
-
const metrics = context.measureText(char);
|
|
106
|
-
const width = metrics.width;
|
|
107
|
-
this._cache.set(cacheKey, width);
|
|
108
|
-
return width;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Injectable, Autowired, INJECTOR_TOKEN, Injector } from '@opensumi/di';
|
|
2
|
-
import { IContextKey, IContextKeyService } from '@opensumi/ide-core-browser';
|
|
3
|
-
import { Disposable, positionToRange } from '@opensumi/ide-core-common';
|
|
4
|
-
import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
DebugBreakpointWidgetContext,
|
|
8
|
-
DebugEditor,
|
|
9
|
-
IDebugBreakpointWidget,
|
|
10
|
-
TSourceBrekpointProperties,
|
|
11
|
-
} from '../../common';
|
|
12
|
-
import { DebugBreakpointsService } from '../view/breakpoints/debug-breakpoints.service';
|
|
13
|
-
|
|
14
|
-
import { CONTEXT_BREAKPOINT_INPUT_FOCUSED } from './../../common/constants';
|
|
15
|
-
import { DebugBreakpointZoneWidget } from './debug-breakpoint-zone-widget';
|
|
16
|
-
|
|
17
|
-
export enum TopStackType {
|
|
18
|
-
exception,
|
|
19
|
-
debugger,
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@Injectable()
|
|
23
|
-
export class DebugBreakpointWidget extends Disposable implements IDebugBreakpointWidget {
|
|
24
|
-
@Autowired(DebugEditor)
|
|
25
|
-
private readonly editor: DebugEditor;
|
|
26
|
-
|
|
27
|
-
@Autowired(DebugBreakpointsService)
|
|
28
|
-
protected debugBreakpointsService: DebugBreakpointsService;
|
|
29
|
-
|
|
30
|
-
@Autowired(IContextKeyService)
|
|
31
|
-
private readonly contextKeyService: IContextKeyService;
|
|
32
|
-
|
|
33
|
-
@Autowired(INJECTOR_TOKEN)
|
|
34
|
-
private readonly injector: Injector;
|
|
35
|
-
|
|
36
|
-
static LINE_HEIGHT_NUMBER = 2;
|
|
37
|
-
|
|
38
|
-
protected zone: DebugBreakpointZoneWidget;
|
|
39
|
-
|
|
40
|
-
private _position: monaco.Position | undefined;
|
|
41
|
-
private breakpointWidgetInputFocus: IContextKey<boolean>;
|
|
42
|
-
|
|
43
|
-
constructor() {
|
|
44
|
-
super();
|
|
45
|
-
this.breakpointWidgetInputFocus = CONTEXT_BREAKPOINT_INPUT_FOCUSED.bind(this.contextKeyService);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get position() {
|
|
49
|
-
return this._position;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
get values() {
|
|
53
|
-
return this.zone?.values;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
get breakpointType(): TSourceBrekpointProperties {
|
|
57
|
-
return this.zone?.breakpointType;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
show(
|
|
61
|
-
position: monaco.Position,
|
|
62
|
-
contexts?: DebugBreakpointWidgetContext,
|
|
63
|
-
defaultContext: TSourceBrekpointProperties = 'condition',
|
|
64
|
-
) {
|
|
65
|
-
this.dispose();
|
|
66
|
-
this._position = position;
|
|
67
|
-
this.addDispose(
|
|
68
|
-
(this.zone = this.injector.get(DebugBreakpointZoneWidget, [this.editor, { ...contexts }, defaultContext])),
|
|
69
|
-
);
|
|
70
|
-
this.addDispose(
|
|
71
|
-
this.zone.onDidChangeBreakpoint(({ context, value }) => {
|
|
72
|
-
if (contexts) {
|
|
73
|
-
contexts[context] = value;
|
|
74
|
-
}
|
|
75
|
-
}),
|
|
76
|
-
);
|
|
77
|
-
this.addDispose(
|
|
78
|
-
this.zone.onFocus(() => {
|
|
79
|
-
this.breakpointWidgetInputFocus.set(true);
|
|
80
|
-
}),
|
|
81
|
-
);
|
|
82
|
-
this.addDispose(
|
|
83
|
-
this.zone.onBlur(() => {
|
|
84
|
-
this.breakpointWidgetInputFocus.set(false);
|
|
85
|
-
}),
|
|
86
|
-
);
|
|
87
|
-
this.addDispose(
|
|
88
|
-
this.zone.onDispose(() => {
|
|
89
|
-
this._position = undefined;
|
|
90
|
-
this.breakpointWidgetInputFocus.set(false);
|
|
91
|
-
}),
|
|
92
|
-
);
|
|
93
|
-
this.zone.show(positionToRange(position), DebugBreakpointWidget.LINE_HEIGHT_NUMBER);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
hide() {
|
|
97
|
-
this.zone?.hide();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
|
|
4
|
-
import { Injectable, Autowired } from '@opensumi/di';
|
|
5
|
-
import { Select, Option } from '@opensumi/ide-components';
|
|
6
|
-
import { localize, Emitter, Event } from '@opensumi/ide-core-common';
|
|
7
|
-
import { ICodeEditor } from '@opensumi/ide-editor';
|
|
8
|
-
import { ZoneWidget } from '@opensumi/ide-monaco-enhance';
|
|
9
|
-
import { ICSSStyleService } from '@opensumi/ide-theme';
|
|
10
|
-
import * as monacoLanguages from '@opensumi/monaco-editor-core/esm/vs/editor/common/languages';
|
|
11
|
-
import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
BreakpointChangeData,
|
|
15
|
-
DebugBreakpointWidgetContext,
|
|
16
|
-
DebugEditor,
|
|
17
|
-
TSourceBrekpointProperties,
|
|
18
|
-
} from '../../common';
|
|
19
|
-
import { DebugBreakpointsService } from '../view/breakpoints/debug-breakpoints.service';
|
|
20
|
-
|
|
21
|
-
import styles from './debug-breakpoint.module.less';
|
|
22
|
-
|
|
23
|
-
@Injectable({ multiple: true })
|
|
24
|
-
export class DebugBreakpointZoneWidget extends ZoneWidget {
|
|
25
|
-
protected _fillContainer(container: HTMLElement): void {}
|
|
26
|
-
|
|
27
|
-
static INPUT_PLACEHOLDER_AFTER = styles.input_placeholder + '::after';
|
|
28
|
-
|
|
29
|
-
@Autowired(DebugBreakpointsService)
|
|
30
|
-
protected debugBreakpointsService: DebugBreakpointsService;
|
|
31
|
-
|
|
32
|
-
@Autowired(ICSSStyleService)
|
|
33
|
-
protected readonly cssManager: ICSSStyleService;
|
|
34
|
-
|
|
35
|
-
private _wrapper: HTMLDivElement;
|
|
36
|
-
private _selection: HTMLDivElement;
|
|
37
|
-
private _input: HTMLDivElement;
|
|
38
|
-
|
|
39
|
-
protected readonly _onDidChangeBreakpoint = new Emitter<BreakpointChangeData>();
|
|
40
|
-
readonly onDidChangeBreakpoint: Event<BreakpointChangeData> = this._onDidChangeBreakpoint.event;
|
|
41
|
-
|
|
42
|
-
protected readonly _onFocus = new Emitter<void>();
|
|
43
|
-
readonly onFocus: Event<void> = this._onFocus.event;
|
|
44
|
-
|
|
45
|
-
protected readonly _onBlur = new Emitter<void>();
|
|
46
|
-
readonly onBlur: Event<void> = this._onBlur.event;
|
|
47
|
-
|
|
48
|
-
private input: ICodeEditor | undefined;
|
|
49
|
-
|
|
50
|
-
get values() {
|
|
51
|
-
return {
|
|
52
|
-
...this.contexts,
|
|
53
|
-
[this.context]: this.input ? this.input.monacoEditor.getValue() || undefined : undefined,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
get breakpointType(): TSourceBrekpointProperties {
|
|
58
|
-
return this.context;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
constructor(
|
|
62
|
-
public editor: DebugEditor,
|
|
63
|
-
private readonly contexts: DebugBreakpointWidgetContext = {},
|
|
64
|
-
private context: TSourceBrekpointProperties = 'condition',
|
|
65
|
-
) {
|
|
66
|
-
super(editor);
|
|
67
|
-
|
|
68
|
-
this._wrapper = document.createElement('div');
|
|
69
|
-
this._selection = document.createElement('div');
|
|
70
|
-
this._input = document.createElement('div');
|
|
71
|
-
|
|
72
|
-
this._container.appendChild(this._wrapper);
|
|
73
|
-
this._wrapper.appendChild(this._selection);
|
|
74
|
-
this._wrapper.appendChild(this._input);
|
|
75
|
-
|
|
76
|
-
ReactDOM.render(<></>, this._input);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public hide(): void {
|
|
80
|
-
if (this.input) {
|
|
81
|
-
this.input.dispose();
|
|
82
|
-
this.input = undefined;
|
|
83
|
-
}
|
|
84
|
-
super.dispose();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
public show(where: monaco.IRange, heightInLines: number): void {
|
|
88
|
-
super.show(where, heightInLines);
|
|
89
|
-
|
|
90
|
-
this.debugBreakpointsService.createBreakpointInput(this._input).then((inputEditor: ICodeEditor) => {
|
|
91
|
-
this.input = inputEditor;
|
|
92
|
-
|
|
93
|
-
const { monacoEditor } = this.input;
|
|
94
|
-
this.setInputMode();
|
|
95
|
-
|
|
96
|
-
this.addDispose(
|
|
97
|
-
monacoEditor.onDidBlurEditorWidget(() => {
|
|
98
|
-
this.inputBlurHandler();
|
|
99
|
-
}),
|
|
100
|
-
);
|
|
101
|
-
this.addDispose(
|
|
102
|
-
monacoEditor.onDidFocusEditorWidget(() => {
|
|
103
|
-
this.inputFocusHandler();
|
|
104
|
-
}),
|
|
105
|
-
);
|
|
106
|
-
this.addDispose(
|
|
107
|
-
monacoEditor.onDidChangeModelContent((textModel: monaco.editor.IModelContentChangedEvent) => {
|
|
108
|
-
if (!this.input) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const value = monacoEditor.getValue();
|
|
113
|
-
if (value.length === 0) {
|
|
114
|
-
this.ensureRenderPlaceholder();
|
|
115
|
-
} else {
|
|
116
|
-
this.clearPlaceholder();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const lineNum = monacoEditor.getModel()!.getLineCount();
|
|
120
|
-
this._relayout(lineNum + 1);
|
|
121
|
-
}),
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
this.syncPreContent();
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
protected createDecorations(): void {
|
|
129
|
-
if (!this.input) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (this.input.monacoEditor.getValue().length !== 0) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
this.input.monacoEditor.deltaDecorations(
|
|
138
|
-
[],
|
|
139
|
-
[
|
|
140
|
-
{
|
|
141
|
-
range: {
|
|
142
|
-
startLineNumber: 1,
|
|
143
|
-
endLineNumber: 0,
|
|
144
|
-
startColumn: 0,
|
|
145
|
-
endColumn: 1,
|
|
146
|
-
},
|
|
147
|
-
options: {
|
|
148
|
-
description: 'debug-breakpoint-zone-widget',
|
|
149
|
-
afterContentClassName: styles.input_placeholder,
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
protected renderOption(context: TSourceBrekpointProperties, label: string): JSX.Element {
|
|
157
|
-
return <Option value={context}>{label}</Option>;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
protected readonly inputFocusHandler = () => {
|
|
161
|
-
this._onFocus.fire();
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
protected readonly inputBlurHandler = () => {
|
|
165
|
-
this._onBlur.fire();
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
protected readonly selectContextHandler = (value: TSourceBrekpointProperties) => {
|
|
169
|
-
if (this.input) {
|
|
170
|
-
this.contexts[this.context] = this.input.monacoEditor.getValue() || undefined;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
this.context = value;
|
|
174
|
-
this.setInputMode();
|
|
175
|
-
this.render();
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
private setInputMode(): void {
|
|
179
|
-
const languageIdentifier = this.editor.getModel()?.getLanguageId();
|
|
180
|
-
const model = this.input?.monacoEditor.getModel();
|
|
181
|
-
if (model && languageIdentifier) {
|
|
182
|
-
model.setMode(this.context === 'logMessage' ? 'plaintext' : languageIdentifier);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
private renderPlaceholder() {
|
|
187
|
-
if (!this.input) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
this.clearPlaceholder();
|
|
192
|
-
|
|
193
|
-
const content = `'${this.placeholder}' !important`;
|
|
194
|
-
this.cssManager.addClass(DebugBreakpointZoneWidget.INPUT_PLACEHOLDER_AFTER, { content });
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
private ensureRenderPlaceholder() {
|
|
198
|
-
if (!this.input) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
this.createDecorations();
|
|
203
|
-
this.renderPlaceholder();
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
private syncPreContent(): void {
|
|
207
|
-
if (this.input) {
|
|
208
|
-
this.input.focus();
|
|
209
|
-
const preContent = this.contexts[this.context] || '';
|
|
210
|
-
this.input.monacoEditor.setValue(preContent);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
private clearPlaceholder() {
|
|
215
|
-
this.cssManager.removeClass(DebugBreakpointZoneWidget.INPUT_PLACEHOLDER_AFTER);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
applyClass() {
|
|
219
|
-
this._wrapper.className = styles.debug_breakpoint_wrapper;
|
|
220
|
-
this._selection.className = styles.debug_breakpoint_selected;
|
|
221
|
-
this._input.className = styles.debug_breakpoint_input;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
applyStyle() {
|
|
225
|
-
this.syncPreContent();
|
|
226
|
-
|
|
227
|
-
ReactDOM.render(
|
|
228
|
-
<Select
|
|
229
|
-
value={this.context}
|
|
230
|
-
selectedRenderer={() => <span className='kt-select-option'>{this.getContextToLocalize(this.context)}</span>}
|
|
231
|
-
onChange={this.selectContextHandler}
|
|
232
|
-
>
|
|
233
|
-
{this.renderOption('condition', this.getContextToLocalize('condition'))}
|
|
234
|
-
{this.renderOption('hitCondition', this.getContextToLocalize('hitCondition'))}
|
|
235
|
-
{this.renderOption('logMessage', this.getContextToLocalize('logMessage'))}
|
|
236
|
-
</Select>,
|
|
237
|
-
this._selection,
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
getContextToLocalize(ctx: TSourceBrekpointProperties) {
|
|
242
|
-
switch (ctx) {
|
|
243
|
-
case 'logMessage':
|
|
244
|
-
return localize('debug.expression.logMessage');
|
|
245
|
-
case 'hitCondition':
|
|
246
|
-
return localize('debug.expression.hitCondition');
|
|
247
|
-
default:
|
|
248
|
-
return localize('debug.expression.condition');
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
get placeholder() {
|
|
253
|
-
switch (this.context) {
|
|
254
|
-
case 'logMessage':
|
|
255
|
-
return localize('debug.expression.log.placeholder');
|
|
256
|
-
case 'hitCondition':
|
|
257
|
-
return localize('debug.expression.hit.placeholder');
|
|
258
|
-
default:
|
|
259
|
-
return localize('debug.expression.condition.placeholder');
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.debug_breakpoint_wrapper {
|
|
2
|
-
height: 100%;
|
|
3
|
-
width: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
border-top-color: rgb(0, 122, 204);
|
|
7
|
-
border-bottom-color: rgb(0, 122, 204);
|
|
8
|
-
border-top-style: solid;
|
|
9
|
-
border-bottom-style: solid;
|
|
10
|
-
border-top-width: 1px;
|
|
11
|
-
border-bottom-width: 1px;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
align-items: center;
|
|
14
|
-
background: var(--editor-background);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.debug_breakpoint_selected {
|
|
18
|
-
padding: 0 10px;
|
|
19
|
-
flex: 1;
|
|
20
|
-
min-width: 120px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.debug_breakpoint_input {
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 28px;
|
|
26
|
-
// (36 - 21) / 2 = 7.5
|
|
27
|
-
margin-top: 7.5px;
|
|
28
|
-
.input_placeholder {
|
|
29
|
-
position: relative;
|
|
30
|
-
}
|
|
31
|
-
}
|