@opensumi/ide-debug 2.21.6 → 2.21.7-rc-1669780664.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +2 -9
- 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 +2 -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 +2 -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 +2 -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 -24
- package/src/browser/assets/breakpoint-conditional-disabled.svg +4 -0
- package/src/browser/assets/breakpoint-conditional-unverified.svg +4 -0
- package/src/browser/assets/breakpoint-conditional.svg +4 -0
- package/src/browser/assets/breakpoint-disabled.svg +4 -0
- package/src/browser/assets/breakpoint-hint.svg +4 -0
- package/src/browser/assets/breakpoint-log-disabled.svg +4 -0
- package/src/browser/assets/breakpoint-log-unverified.svg +4 -0
- package/src/browser/assets/breakpoint-log.svg +4 -0
- package/src/browser/assets/breakpoint-unsupported.svg +4 -0
- package/src/browser/assets/breakpoint-unverified.svg +4 -0
- package/src/browser/assets/breakpoint.svg +4 -0
- package/src/browser/assets/breakpoints-activate-inverse.svg +4 -0
- package/src/browser/assets/breakpoints-activate.svg +4 -0
- package/src/browser/assets/configure-inverse.svg +4 -0
- package/src/browser/assets/configure.svg +4 -0
- package/src/browser/assets/continue-inverse.svg +4 -0
- package/src/browser/assets/current-and-breakpoint.svg +4 -0
- package/src/browser/assets/current-arrow.svg +4 -0
- package/src/browser/assets/remove-all-inverse.svg +4 -0
- package/src/browser/assets/remove-all.svg +4 -0
- package/src/browser/assets/repl-inverse.svg +4 -0
- package/src/browser/assets/repl.svg +4 -0
- package/src/browser/assets/restart-inverse.svg +4 -0
- package/src/browser/assets/stackframe-and-breakpoint.svg +4 -0
- package/src/browser/assets/stackframe-arrow.svg +4 -0
- package/src/browser/assets/start-inverse.svg +4 -0
- package/src/browser/breakpoint/breakpoint-decoration.ts +57 -0
- package/src/browser/breakpoint/breakpoint-manager.ts +348 -0
- package/src/browser/breakpoint/breakpoint-marker.ts +70 -0
- package/src/browser/breakpoint/index.ts +3 -0
- package/src/browser/components/debug-action/index.module.less +73 -0
- package/src/browser/components/debug-action/index.tsx +40 -0
- package/src/browser/components/debug-exception-widget.less +42 -0
- package/src/browser/components/floating-click-widget/index.module.less +5 -0
- package/src/browser/components/floating-click-widget/index.tsx +21 -0
- package/src/browser/components/index.ts +1 -0
- package/src/browser/contextkeys/debug-call-stack-item-type-key.ts +4 -0
- package/src/browser/contextkeys/debug-contextkey.service.ts +54 -0
- package/src/browser/contextkeys/index.ts +1 -0
- package/src/browser/debug-ansi-handle.ts +521 -0
- package/src/browser/debug-configuration-manager.ts +513 -0
- package/src/browser/debug-configuration-model.ts +66 -0
- package/src/browser/debug-contribution.ts +904 -0
- package/src/browser/debug-exception-widget.tsx +89 -0
- package/src/browser/debug-link-detector.ts +234 -0
- package/src/browser/debug-memory.ts +220 -0
- package/src/browser/debug-preferences.ts +70 -0
- package/src/browser/debug-progress.service.ts +122 -0
- package/src/browser/debug-schema-updater.ts +67 -0
- package/src/browser/debug-service.ts +42 -0
- package/src/browser/debug-session-connection.ts +333 -0
- package/src/browser/debug-session-contribution.ts +57 -0
- package/src/browser/debug-session-manager.ts +622 -0
- package/src/browser/debug-session.ts +1179 -0
- package/src/browser/debug-style.less +128 -0
- package/src/browser/debugUtils.ts +110 -0
- package/src/browser/editor/debug-breakpoint-widget.ts +99 -0
- package/src/browser/editor/debug-breakpoint-zone-widget.tsx +262 -0
- package/src/browser/editor/debug-breakpoint.module.less +31 -0
- package/src/browser/editor/debug-editor-contribution.ts +590 -0
- package/src/browser/editor/debug-expression-provider.ts +101 -0
- package/src/browser/editor/debug-hover-model.ts +38 -0
- package/src/browser/editor/debug-hover-source.ts +107 -0
- package/src/browser/editor/debug-hover-tree.model.service.ts +332 -0
- package/src/browser/editor/debug-hover-widget.tsx +200 -0
- package/src/browser/editor/debug-hover.module.less +29 -0
- package/src/browser/editor/debug-hover.view.tsx +147 -0
- package/src/browser/editor/debug-model-manager.ts +220 -0
- package/src/browser/editor/debug-model.ts +853 -0
- package/src/browser/editor/debug-run-to-cursor.service.ts +180 -0
- package/src/browser/editor/debug-styles.ts +66 -0
- package/src/browser/editor/evaluatable-expression.ts +47 -0
- package/src/browser/editor/index.ts +6 -0
- package/src/browser/index.ts +121 -0
- package/src/browser/markers/index.ts +2 -0
- package/src/browser/markers/marker-manager.ts +201 -0
- package/src/browser/markers/marker.ts +20 -0
- package/src/browser/model/debug-source.ts +144 -0
- package/src/browser/model/debug-stack-frame.ts +111 -0
- package/src/browser/model/debug-thread.ts +186 -0
- package/src/browser/model/debug-watch.ts +130 -0
- package/src/browser/model/index.ts +4 -0
- package/src/browser/preferences/launch-folder-preference-provider.ts +23 -0
- package/src/browser/preferences/launch-preferences-contribution.ts +9 -0
- package/src/browser/preferences/launch-preferences.ts +16 -0
- package/src/browser/tree/debug-console-tree-node.define.tsx +76 -0
- package/src/browser/tree/debug-tree-node.define.ts +768 -0
- package/src/browser/tree/index.ts +2 -0
- package/src/browser/view/breakpoints/debug-breakpoints.module.less +72 -0
- package/src/browser/view/breakpoints/debug-breakpoints.service.ts +217 -0
- package/src/browser/view/breakpoints/debug-breakpoints.view.tsx +174 -0
- package/src/browser/view/configuration/debug-configuration.module.less +110 -0
- package/src/browser/view/configuration/debug-configuration.service.ts +170 -0
- package/src/browser/view/configuration/debug-configuration.view.tsx +252 -0
- package/src/browser/view/configuration/debug-toolbar.service.ts +167 -0
- package/src/browser/view/configuration/debug-toolbar.view.tsx +335 -0
- package/src/browser/view/console/debug-console-filter.model.ts +49 -0
- package/src/browser/view/console/debug-console-filter.service.ts +81 -0
- package/src/browser/view/console/debug-console-filter.view.tsx +78 -0
- package/src/browser/view/console/debug-console-model.ts +48 -0
- package/src/browser/view/console/debug-console-session.ts +164 -0
- package/src/browser/view/console/debug-console-toolbar.view.tsx +28 -0
- package/src/browser/view/console/debug-console-tree.model.service.ts +550 -0
- package/src/browser/view/console/debug-console.contribution.ts +181 -0
- package/src/browser/view/console/debug-console.module.less +373 -0
- package/src/browser/view/console/debug-console.service.ts +433 -0
- package/src/browser/view/console/debug-console.view.tsx +500 -0
- package/src/browser/view/debug-view-model.ts +182 -0
- package/src/browser/view/frames/debug-call-stack-frame.view.tsx +224 -0
- package/src/browser/view/frames/debug-call-stack-session.view.tsx +237 -0
- package/src/browser/view/frames/debug-call-stack-thread.view.tsx +93 -0
- package/src/browser/view/frames/debug-call-stack.contribution.ts +88 -0
- package/src/browser/view/frames/debug-call-stack.module.less +193 -0
- package/src/browser/view/frames/debug-call-stack.operation.tsx +97 -0
- package/src/browser/view/frames/debug-call-stack.service.ts +105 -0
- package/src/browser/view/frames/debug-call-stack.view.tsx +43 -0
- package/src/browser/view/variables/debug-variables-model.ts +38 -0
- package/src/browser/view/variables/debug-variables-tree.model.service.ts +467 -0
- package/src/browser/view/variables/debug-variables.contribution.ts +244 -0
- package/src/browser/view/variables/debug-variables.module.less +149 -0
- package/src/browser/view/variables/debug-variables.view.tsx +303 -0
- package/src/browser/view/watch/debug-watch-model.ts +38 -0
- package/src/browser/view/watch/debug-watch-tree.model.service.ts +567 -0
- package/src/browser/view/watch/debug-watch.contribution.ts +167 -0
- package/src/browser/view/watch/debug-watch.module.less +189 -0
- package/src/browser/view/watch/debug-watch.view.tsx +337 -0
- package/src/common/constants.ts +81 -0
- package/src/common/debug-breakpoint.ts +43 -0
- package/src/common/debug-configuration.ts +68 -0
- package/src/common/debug-editor.ts +4 -0
- package/src/common/debug-hover.ts +31 -0
- package/src/common/debug-model.ts +247 -0
- package/src/common/debug-progress.ts +8 -0
- package/src/common/debug-schema-updater.ts +1 -0
- package/src/common/debug-service.ts +176 -0
- package/src/common/debug-session-options.ts +19 -0
- package/src/common/debug-session.ts +200 -0
- package/src/common/evaluatable-expression.ts +43 -0
- package/src/common/index.ts +14 -0
- package/src/common/inline-values.ts +77 -0
- package/src/common/terminal.ts +163 -0
- package/src/common/types.ts +86 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { Injectable, Autowired, INJECTOR_TOKEN, Injector, Optional } from '@opensumi/di';
|
|
2
|
+
import {
|
|
3
|
+
IContextKeyService,
|
|
4
|
+
PreferenceService,
|
|
5
|
+
MonacoOverrideServiceRegistry,
|
|
6
|
+
ServiceNames,
|
|
7
|
+
Position,
|
|
8
|
+
positionToRange,
|
|
9
|
+
} from '@opensumi/ide-core-browser';
|
|
10
|
+
import {
|
|
11
|
+
IDisposable,
|
|
12
|
+
Disposable,
|
|
13
|
+
RunOnceScheduler,
|
|
14
|
+
CancellationTokenSource,
|
|
15
|
+
onUnexpectedExternalError,
|
|
16
|
+
createMemoizer,
|
|
17
|
+
Event,
|
|
18
|
+
arrays,
|
|
19
|
+
Constants,
|
|
20
|
+
strings,
|
|
21
|
+
} from '@opensumi/ide-core-browser';
|
|
22
|
+
import { IEditor, IDecorationApplyOptions } from '@opensumi/ide-editor';
|
|
23
|
+
import { WorkbenchEditorService } from '@opensumi/ide-editor';
|
|
24
|
+
import { IEditorFeatureContribution } from '@opensumi/ide-editor/lib/browser';
|
|
25
|
+
import { MonacoCodeService } from '@opensumi/ide-editor/lib/browser/editor.override';
|
|
26
|
+
import { WorkbenchEditorServiceImpl } from '@opensumi/ide-editor/lib/browser/workbench-editor.service';
|
|
27
|
+
import { languageFeaturesService } from '@opensumi/ide-monaco/lib/browser/monaco-api/languages';
|
|
28
|
+
import { Range } from '@opensumi/monaco-editor-core/esm/vs/editor/common/core/range';
|
|
29
|
+
import { StandardTokenType } from '@opensumi/monaco-editor-core/esm/vs/editor/common/encodedTokenAttributes';
|
|
30
|
+
import { ITextModel } from '@opensumi/monaco-editor-core/esm/vs/editor/common/model';
|
|
31
|
+
import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
32
|
+
import { DebugProtocol } from '@opensumi/vscode-debugprotocol';
|
|
33
|
+
|
|
34
|
+
import { DebugContextKey } from '../contextkeys/debug-contextkey.service';
|
|
35
|
+
import { DebugExceptionWidget } from '../debug-exception-widget';
|
|
36
|
+
import { DebugSession } from '../debug-session';
|
|
37
|
+
import { DebugSessionManager } from '../debug-session-manager';
|
|
38
|
+
import { DebugStackFrame } from '../model';
|
|
39
|
+
import { DebugVariable, DebugWatchNode, DebugWatchRoot } from '../tree';
|
|
40
|
+
|
|
41
|
+
import { DebugState, IDebugExceptionInfo, IDebugSession, IDebugSessionManager } from './../../common';
|
|
42
|
+
import { InlineValueContext } from './../../common/inline-values';
|
|
43
|
+
import { DEFAULT_WORD_REGEXP } from './../debugUtils';
|
|
44
|
+
import { DebugModelManager } from './debug-model-manager';
|
|
45
|
+
|
|
46
|
+
const INLINE_VALUE_DECORATION_KEY = 'inlinevaluedecoration';
|
|
47
|
+
const MAX_NUM_INLINE_VALUES = 100;
|
|
48
|
+
const MAX_INLINE_DECORATOR_LENGTH = 150; // 调试时每个内联修饰符的最大字符串长度。超过这个值就在后面显示 ...
|
|
49
|
+
const MAX_TOKENIZATION_LINE_LEN = 500; // 如果这行太长了,则跳过该行的内联值
|
|
50
|
+
|
|
51
|
+
const { flatten } = arrays;
|
|
52
|
+
|
|
53
|
+
class InlineSegment {
|
|
54
|
+
constructor(public column: number, public text: string) {}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function createInlineValueDecoration(
|
|
58
|
+
lineNumber: number,
|
|
59
|
+
contentText: string,
|
|
60
|
+
column = Constants.MAX_SAFE_SMALL_INTEGER,
|
|
61
|
+
): IDecorationApplyOptions {
|
|
62
|
+
if (contentText.length > MAX_INLINE_DECORATOR_LENGTH) {
|
|
63
|
+
contentText = contentText.substr(0, MAX_INLINE_DECORATOR_LENGTH) + '...';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
range: {
|
|
68
|
+
startLineNumber: lineNumber,
|
|
69
|
+
endLineNumber: lineNumber,
|
|
70
|
+
startColumn: column,
|
|
71
|
+
endColumn: column,
|
|
72
|
+
},
|
|
73
|
+
renderOptions: {
|
|
74
|
+
after: {
|
|
75
|
+
contentText,
|
|
76
|
+
backgroundColor: 'rgba(255, 200, 0, 0.2)',
|
|
77
|
+
margin: '10px',
|
|
78
|
+
},
|
|
79
|
+
dark: {
|
|
80
|
+
after: {
|
|
81
|
+
color: 'rgba(255, 255, 255, 0.5)',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
light: {
|
|
85
|
+
after: {
|
|
86
|
+
color: 'rgba(0, 0, 0, 0.5)',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function createInlineValueDecorationsInsideRange(
|
|
94
|
+
expressions: ReadonlyArray<DebugVariable>,
|
|
95
|
+
range: Range,
|
|
96
|
+
model: ITextModel,
|
|
97
|
+
wordToLineNumbersMap: Map<string, number[]>,
|
|
98
|
+
): IDecorationApplyOptions[] {
|
|
99
|
+
const nameValueMap = new Map<string, string>();
|
|
100
|
+
for (const expr of expressions) {
|
|
101
|
+
nameValueMap.set(expr.name, expr.value);
|
|
102
|
+
if (nameValueMap.size >= MAX_NUM_INLINE_VALUES) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const lineToNamesMap: Map<number, string[]> = new Map<number, string[]>();
|
|
108
|
+
|
|
109
|
+
nameValueMap.forEach((_value, name) => {
|
|
110
|
+
const lineNumbers = wordToLineNumbersMap.get(name);
|
|
111
|
+
if (lineNumbers) {
|
|
112
|
+
for (const lineNumber of lineNumbers) {
|
|
113
|
+
if (range.containsPosition(new Position(lineNumber, 0))) {
|
|
114
|
+
if (!lineToNamesMap.has(lineNumber)) {
|
|
115
|
+
lineToNamesMap.set(lineNumber, []);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (lineToNamesMap.get(lineNumber)!.indexOf(name) === -1) {
|
|
119
|
+
lineToNamesMap.get(lineNumber)!.push(name);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const decorations: IDecorationApplyOptions[] = [];
|
|
127
|
+
|
|
128
|
+
lineToNamesMap.forEach((names, line) => {
|
|
129
|
+
const contentText = names
|
|
130
|
+
.sort((first, second) => {
|
|
131
|
+
const content = model.getLineContent(line);
|
|
132
|
+
return content.indexOf(first) - content.indexOf(second);
|
|
133
|
+
})
|
|
134
|
+
.map((name) => `${name} = ${nameValueMap.get(name)}`)
|
|
135
|
+
.join(', ');
|
|
136
|
+
decorations.push(createInlineValueDecoration(line, contentText));
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
return decorations;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function getWordToLineNumbersMap(model: ITextModel | null): Map<string, number[]> {
|
|
143
|
+
const result = new Map<string, number[]>();
|
|
144
|
+
if (!model) {
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
for (let lineNumber = 1, len = model.getLineCount(); lineNumber <= len; ++lineNumber) {
|
|
149
|
+
const lineContent = model.getLineContent(lineNumber);
|
|
150
|
+
|
|
151
|
+
if (lineContent.length > MAX_TOKENIZATION_LINE_LEN) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
model.tokenization.forceTokenization(lineNumber);
|
|
156
|
+
const lineTokens = model.tokenization.getLineTokens(lineNumber);
|
|
157
|
+
for (let tokenIndex = 0, tokenCount = lineTokens.getCount(); tokenIndex < tokenCount; tokenIndex++) {
|
|
158
|
+
const tokenType = lineTokens.getStandardTokenType(tokenIndex);
|
|
159
|
+
|
|
160
|
+
if (tokenType === StandardTokenType.Other) {
|
|
161
|
+
DEFAULT_WORD_REGEXP.lastIndex = 0;
|
|
162
|
+
|
|
163
|
+
const tokenStartOffset = lineTokens.getStartOffset(tokenIndex);
|
|
164
|
+
const tokenEndOffset = lineTokens.getEndOffset(tokenIndex);
|
|
165
|
+
const tokenStr = lineContent.substring(tokenStartOffset, tokenEndOffset);
|
|
166
|
+
const wordMatch = DEFAULT_WORD_REGEXP.exec(tokenStr);
|
|
167
|
+
|
|
168
|
+
if (wordMatch) {
|
|
169
|
+
const word = wordMatch[0];
|
|
170
|
+
if (!result.has(word)) {
|
|
171
|
+
result.set(word, []);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
result.get(word)!.push(lineNumber);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@Injectable()
|
|
184
|
+
export class DebugEditorContribution implements IEditorFeatureContribution {
|
|
185
|
+
private static readonly MEMOIZER = createMemoizer();
|
|
186
|
+
|
|
187
|
+
@Autowired(INJECTOR_TOKEN)
|
|
188
|
+
protected readonly injector: Injector;
|
|
189
|
+
|
|
190
|
+
@Autowired(IContextKeyService)
|
|
191
|
+
protected readonly contextKeyService: IContextKeyService;
|
|
192
|
+
|
|
193
|
+
@Autowired(DebugModelManager)
|
|
194
|
+
protected readonly debugModelManager: DebugModelManager;
|
|
195
|
+
|
|
196
|
+
@Autowired(IDebugSessionManager)
|
|
197
|
+
protected readonly debugSessionManager: DebugSessionManager;
|
|
198
|
+
|
|
199
|
+
@Autowired(PreferenceService)
|
|
200
|
+
protected readonly preferenceService: PreferenceService;
|
|
201
|
+
|
|
202
|
+
@Autowired(MonacoOverrideServiceRegistry)
|
|
203
|
+
private readonly overrideServicesRegistry: MonacoOverrideServiceRegistry;
|
|
204
|
+
|
|
205
|
+
@Autowired(WorkbenchEditorService)
|
|
206
|
+
private readonly editorService: WorkbenchEditorServiceImpl;
|
|
207
|
+
|
|
208
|
+
@Autowired(DebugContextKey)
|
|
209
|
+
protected readonly debugContextKey: DebugContextKey;
|
|
210
|
+
|
|
211
|
+
private readonly disposer: Disposable = new Disposable();
|
|
212
|
+
private readonly editorDisposer: Disposable = new Disposable();
|
|
213
|
+
|
|
214
|
+
private debugExceptionWidget: DebugExceptionWidget | undefined;
|
|
215
|
+
|
|
216
|
+
constructor(@Optional() private readonly editor: IEditor) {}
|
|
217
|
+
|
|
218
|
+
public contribute(editor: IEditor): IDisposable {
|
|
219
|
+
this.disposer.addDispose(
|
|
220
|
+
this.debugSessionManager.onDidChangeActiveDebugSession(() => {
|
|
221
|
+
const currentSession = this.debugSessionManager.currentSession;
|
|
222
|
+
if (currentSession) {
|
|
223
|
+
this.editorDisposer.addDispose(
|
|
224
|
+
currentSession.onDidChange(async () => {
|
|
225
|
+
this.setHoverEnabled(editor, currentSession.state === DebugState.Running);
|
|
226
|
+
|
|
227
|
+
const currentFrame = currentSession.currentThread?.currentFrame;
|
|
228
|
+
if (!currentFrame) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (editor.currentUri && currentFrame.source?.uri.isEqual(editor.currentUri)) {
|
|
233
|
+
await this.toggleExceptionWidget();
|
|
234
|
+
}
|
|
235
|
+
}),
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
this.editorDisposer.addDispose(
|
|
239
|
+
currentSession.onDidExitAdapter(() => {
|
|
240
|
+
this.setHoverEnabled(editor, true);
|
|
241
|
+
}),
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
this.editorDisposer.addDispose(
|
|
245
|
+
this.editorService.onActiveResourceChange((resource) => {
|
|
246
|
+
if (resource?.uri.toString() === currentSession.getModel()?.uri.toString()) {
|
|
247
|
+
this.setHoverEnabled(editor);
|
|
248
|
+
} else {
|
|
249
|
+
this.setHoverEnabled(editor, true);
|
|
250
|
+
}
|
|
251
|
+
}),
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
this.disposer.addDispose([
|
|
255
|
+
Event.any<void | DebugProtocol.StoppedEvent>(
|
|
256
|
+
currentSession.onDidChangeCallStack,
|
|
257
|
+
currentSession.onDidStop,
|
|
258
|
+
)(async () => {
|
|
259
|
+
await this.directRunUpdateInlineValueDecorations(editor);
|
|
260
|
+
}),
|
|
261
|
+
|
|
262
|
+
currentSession.onDidExitAdapter(() => {
|
|
263
|
+
this.removeInlineValuesScheduler(editor).schedule();
|
|
264
|
+
this.editorDisposer.dispose();
|
|
265
|
+
}),
|
|
266
|
+
]);
|
|
267
|
+
|
|
268
|
+
this.disposer.addDispose(
|
|
269
|
+
currentSession.onDidChangeState((state: DebugState) => {
|
|
270
|
+
if (state !== DebugState.Stopped) {
|
|
271
|
+
this.toggleExceptionWidget();
|
|
272
|
+
}
|
|
273
|
+
}),
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
this.disposer.addDispose(currentSession);
|
|
277
|
+
|
|
278
|
+
this.registerEditorListener(editor);
|
|
279
|
+
}
|
|
280
|
+
}),
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
this.disposer.addDispose(this.editorDisposer);
|
|
284
|
+
|
|
285
|
+
this.toggleExceptionWidget();
|
|
286
|
+
return this.disposer;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
private registerEditorListener(editor: IEditor): void {
|
|
290
|
+
this.editorDisposer.addDispose(
|
|
291
|
+
editor.monacoEditor.onKeyDown(async (keydownEvent: monaco.IKeyboardEvent) => {
|
|
292
|
+
// 如果当前 session 会话的 editor 和当前打开的 editor 不一致,则不作处理
|
|
293
|
+
if (
|
|
294
|
+
this.debugSessionManager.currentSession?.currentFrame?.source?.uri.toString() !==
|
|
295
|
+
editor.currentUri?.toString()
|
|
296
|
+
) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (keydownEvent.keyCode === monaco.KeyCode.Alt) {
|
|
301
|
+
this.setHoverEnabled(editor, true);
|
|
302
|
+
this.debugModelManager.model?.getDebugHoverWidget().hide();
|
|
303
|
+
const listener = editor.monacoEditor.onKeyUp(async (keyupEvent: monaco.IKeyboardEvent) => {
|
|
304
|
+
if (keyupEvent.keyCode === monaco.KeyCode.Alt) {
|
|
305
|
+
this.setHoverEnabled(editor, false);
|
|
306
|
+
this.debugModelManager.model?.getDebugHoverWidget().show();
|
|
307
|
+
listener.dispose();
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}),
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
this.editorDisposer.addDispose(
|
|
315
|
+
editor.monacoEditor.onDidChangeModelContent(async () => {
|
|
316
|
+
DebugEditorContribution.MEMOIZER.clear();
|
|
317
|
+
await this.directRunUpdateInlineValueDecorations(editor);
|
|
318
|
+
}),
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
this.editorDisposer.addDispose(
|
|
322
|
+
editor.monacoEditor.onDidChangeModel(async () => {
|
|
323
|
+
this.toggleExceptionWidget();
|
|
324
|
+
await this.directRunUpdateInlineValueDecorations(editor);
|
|
325
|
+
}),
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
public registerDecorationType(): void {
|
|
330
|
+
const codeEditorService = this.overrideServicesRegistry.getRegisteredService(
|
|
331
|
+
ServiceNames.CODE_EDITOR_SERVICE,
|
|
332
|
+
) as MonacoCodeService;
|
|
333
|
+
codeEditorService.registerDecorationType('inline-value-decoration', INLINE_VALUE_DECORATION_KEY, {});
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
public setHoverEnabled(editor: IEditor, isEnabled = !this.debugContextKey.contextInDdebugMode.get()) {
|
|
337
|
+
editor.monacoEditor.updateOptions({
|
|
338
|
+
hover: {
|
|
339
|
+
enabled: isEnabled,
|
|
340
|
+
},
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
private async directRunUpdateInlineValueDecorations(editor: IEditor): Promise<void> {
|
|
345
|
+
const stackFrame = this.debugSessionManager.currentSession?.currentFrame;
|
|
346
|
+
if (stackFrame) {
|
|
347
|
+
DebugEditorContribution.MEMOIZER.clear();
|
|
348
|
+
await this.updateInlineValueDecorations(stackFrame, editor);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
private removeInlineValuesScheduler(editor: IEditor): RunOnceScheduler {
|
|
353
|
+
return new RunOnceScheduler(() => editor.monacoEditor.removeDecorationsByType(INLINE_VALUE_DECORATION_KEY), 100);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
private async updateInlineValueDecorations(stackFrame: DebugStackFrame | undefined, editor: IEditor): Promise<void> {
|
|
357
|
+
if (!editor) {
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const varValueFormat = '{0} = {1}';
|
|
362
|
+
const separator = ', ';
|
|
363
|
+
|
|
364
|
+
const model = editor.monacoEditor.getModel();
|
|
365
|
+
if (
|
|
366
|
+
!this.preferenceService.get('debug.inline.values') ||
|
|
367
|
+
!model ||
|
|
368
|
+
!stackFrame ||
|
|
369
|
+
model.uri.toString() !== stackFrame.source?.uri.toString()
|
|
370
|
+
) {
|
|
371
|
+
if (!this.removeInlineValuesScheduler(editor).isScheduled()) {
|
|
372
|
+
this.removeInlineValuesScheduler(editor).schedule();
|
|
373
|
+
}
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
this.removeInlineValuesScheduler(editor).cancel();
|
|
378
|
+
|
|
379
|
+
let allDecorations: IDecorationApplyOptions[];
|
|
380
|
+
|
|
381
|
+
if (languageFeaturesService.inlineValuesProvider.has(model)) {
|
|
382
|
+
const findVariable = async (_key: string, caseSensitiveLookup: boolean): Promise<string | undefined> => {
|
|
383
|
+
const scopes = await stackFrame.getMostSpecificScopes(stackFrame.range());
|
|
384
|
+
const key = caseSensitiveLookup ? _key : _key.toLowerCase();
|
|
385
|
+
for (const scope of scopes) {
|
|
386
|
+
await scope.ensureLoaded();
|
|
387
|
+
const variables = (scope.children as DebugVariable[]) || [];
|
|
388
|
+
const found = variables.find((v) => (caseSensitiveLookup ? v.name === key : v.name.toLowerCase() === key));
|
|
389
|
+
if (found) {
|
|
390
|
+
return found.value;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return undefined;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
const ctx: InlineValueContext = {
|
|
397
|
+
frameId: stackFrame.raw.id,
|
|
398
|
+
stoppedLocation: (() => {
|
|
399
|
+
const sr = stackFrame.range();
|
|
400
|
+
return new Range(sr.startLineNumber, sr.startColumn + 1, sr.endLineNumber, sr.endColumn + 1);
|
|
401
|
+
})(),
|
|
402
|
+
};
|
|
403
|
+
const token = new CancellationTokenSource().token;
|
|
404
|
+
|
|
405
|
+
const ranges = editor.monacoEditor.getVisibleRanges();
|
|
406
|
+
const providers = languageFeaturesService.inlineValuesProvider.ordered(model).reverse();
|
|
407
|
+
|
|
408
|
+
allDecorations = [];
|
|
409
|
+
const lineDecorations = new Map<number, InlineSegment[]>();
|
|
410
|
+
|
|
411
|
+
const promises = flatten(
|
|
412
|
+
providers.map((provider) =>
|
|
413
|
+
ranges.map((range) =>
|
|
414
|
+
Promise.resolve(provider.provideInlineValues(model, range, ctx, token)).then(
|
|
415
|
+
async (result) => {
|
|
416
|
+
if (result) {
|
|
417
|
+
for (const iv of result) {
|
|
418
|
+
let text: string | undefined;
|
|
419
|
+
switch (iv.type) {
|
|
420
|
+
case 'text':
|
|
421
|
+
text = iv.text;
|
|
422
|
+
break;
|
|
423
|
+
case 'variable': {
|
|
424
|
+
let va = iv.variableName;
|
|
425
|
+
if (!va) {
|
|
426
|
+
const lineContent = model.getLineContent(iv.range.startLineNumber);
|
|
427
|
+
va = lineContent.substring(iv.range.startColumn - 1, iv.range.endColumn - 1);
|
|
428
|
+
}
|
|
429
|
+
const value = await findVariable(va, iv.caseSensitiveLookup);
|
|
430
|
+
if (value) {
|
|
431
|
+
text = strings.format(varValueFormat, va, value);
|
|
432
|
+
}
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
case 'expression': {
|
|
436
|
+
let expr = iv.expression;
|
|
437
|
+
if (!expr) {
|
|
438
|
+
const lineContent = model.getLineContent(iv.range.startLineNumber);
|
|
439
|
+
expr = lineContent.substring(iv.range.startColumn - 1, iv.range.endColumn - 1);
|
|
440
|
+
}
|
|
441
|
+
if (expr) {
|
|
442
|
+
const root = new DebugWatchRoot(stackFrame.thread.session);
|
|
443
|
+
const expression = new DebugWatchNode(stackFrame.thread.session, expr, root);
|
|
444
|
+
await expression.evaluate(expr);
|
|
445
|
+
if (expression.available) {
|
|
446
|
+
text = strings.format(varValueFormat, expr, expression.description);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (text) {
|
|
454
|
+
const line = iv.range.startLineNumber;
|
|
455
|
+
let lineSegments = lineDecorations.get(line);
|
|
456
|
+
if (!lineSegments) {
|
|
457
|
+
lineSegments = [];
|
|
458
|
+
lineDecorations.set(line, lineSegments);
|
|
459
|
+
}
|
|
460
|
+
if (!lineSegments.some((iv) => iv.text === text)) {
|
|
461
|
+
// de-dupe
|
|
462
|
+
lineSegments.push(new InlineSegment(iv.range.startColumn, text));
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
(err) => {
|
|
469
|
+
onUnexpectedExternalError(err);
|
|
470
|
+
},
|
|
471
|
+
),
|
|
472
|
+
),
|
|
473
|
+
),
|
|
474
|
+
);
|
|
475
|
+
|
|
476
|
+
await Promise.all(promises);
|
|
477
|
+
|
|
478
|
+
lineDecorations.forEach((segments, line) => {
|
|
479
|
+
if (segments.length > 0) {
|
|
480
|
+
segments = segments.sort((a, b) => a.column - b.column);
|
|
481
|
+
const text = segments.map((s) => s.text).join(separator);
|
|
482
|
+
allDecorations.push(createInlineValueDecoration(line, text));
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
} else {
|
|
486
|
+
const scopes = await stackFrame.getMostSpecificScopes(stackFrame.range());
|
|
487
|
+
// 获取 scope 链中的所有顶级变量
|
|
488
|
+
const decorationsPerScope = await Promise.all(
|
|
489
|
+
scopes.map(async (scope) => {
|
|
490
|
+
await scope.ensureLoaded();
|
|
491
|
+
const variables = scope.children || [];
|
|
492
|
+
const sfr = stackFrame.range();
|
|
493
|
+
const spr = scope.range();
|
|
494
|
+
|
|
495
|
+
let range = new Range(0, 0, sfr.startLineNumber, sfr.startColumn);
|
|
496
|
+
if (spr) {
|
|
497
|
+
range = range.setStartPosition(spr.startLineNumber, spr.startColumn);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return createInlineValueDecorationsInsideRange(
|
|
501
|
+
variables as DebugVariable[],
|
|
502
|
+
range,
|
|
503
|
+
model,
|
|
504
|
+
getWordToLineNumbersMap(editor?.monacoEditor.getModel()!),
|
|
505
|
+
);
|
|
506
|
+
}),
|
|
507
|
+
);
|
|
508
|
+
|
|
509
|
+
allDecorations = decorationsPerScope.reduce((previous, current) => previous.concat(current), []);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
editor.monacoEditor.setDecorationsByType(
|
|
513
|
+
'inline-value-decoration',
|
|
514
|
+
INLINE_VALUE_DECORATION_KEY,
|
|
515
|
+
allDecorations as any[],
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// debug exception widget
|
|
520
|
+
private async toggleExceptionWidget(): Promise<void> {
|
|
521
|
+
const currentSession = this.debugSessionManager.currentSession;
|
|
522
|
+
if (!currentSession) {
|
|
523
|
+
this.closeExceptionWidget();
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
const { currentThread } = currentSession;
|
|
528
|
+
if (!currentThread) {
|
|
529
|
+
this.closeExceptionWidget();
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// 找出第一个调用堆栈帧是引发异常的帧,且 source.presentationHint 为非 deemphasize 的
|
|
534
|
+
const exceptionStack = currentThread.frames.find(
|
|
535
|
+
(s) => !!(s && s.source && s.source.available && s.source.presentationHint !== 'deemphasize'),
|
|
536
|
+
);
|
|
537
|
+
if (!exceptionStack) {
|
|
538
|
+
this.closeExceptionWidget();
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const samUri = this.editor.currentUri?.isEqual(exceptionStack.source?.uri!);
|
|
543
|
+
|
|
544
|
+
if (this.debugExceptionWidget && !samUri) {
|
|
545
|
+
this.closeExceptionWidget();
|
|
546
|
+
} else if (samUri) {
|
|
547
|
+
const exceptionInfo = await currentThread?.fetchExceptionInfo();
|
|
548
|
+
if (exceptionInfo) {
|
|
549
|
+
this.showExceptionWidget(
|
|
550
|
+
exceptionInfo,
|
|
551
|
+
currentSession,
|
|
552
|
+
exceptionStack.range().startLineNumber,
|
|
553
|
+
exceptionStack.range().startColumn,
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
private showExceptionWidget(
|
|
560
|
+
exceptionInfo: IDebugExceptionInfo,
|
|
561
|
+
debugSession: DebugSession,
|
|
562
|
+
lineNumber: number,
|
|
563
|
+
column: number,
|
|
564
|
+
): void {
|
|
565
|
+
if (this.debugExceptionWidget) {
|
|
566
|
+
this.debugExceptionWidget.dispose();
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
const editor = debugSession?.currentEditor();
|
|
570
|
+
|
|
571
|
+
this.debugExceptionWidget = this.injector.get(DebugExceptionWidget, [editor, exceptionInfo]);
|
|
572
|
+
this.debugExceptionWidget.show(positionToRange({ lineNumber, column }), 10);
|
|
573
|
+
this.debugExceptionWidget.focus();
|
|
574
|
+
editor?.revealRangeInCenter({
|
|
575
|
+
startLineNumber: lineNumber,
|
|
576
|
+
startColumn: column,
|
|
577
|
+
endLineNumber: lineNumber,
|
|
578
|
+
endColumn: column,
|
|
579
|
+
});
|
|
580
|
+
this.debugContextKey.contextExceptionWidgetVisible.set(true);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
private closeExceptionWidget(): void {
|
|
584
|
+
if (this.debugExceptionWidget) {
|
|
585
|
+
this.debugContextKey.contextExceptionWidgetVisible.set(false);
|
|
586
|
+
this.debugExceptionWidget.dispose();
|
|
587
|
+
this.debugExceptionWidget = undefined;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Injectable, Autowired } from '@opensumi/di';
|
|
2
|
+
import { CancellationTokenSource, arrays, IRange } from '@opensumi/ide-core-common';
|
|
3
|
+
import { ITextModel } from '@opensumi/ide-monaco/lib/browser/monaco-api/types';
|
|
4
|
+
import * as monaco from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
|
|
5
|
+
|
|
6
|
+
import { IEvaluatableExpressionService } from './evaluatable-expression';
|
|
7
|
+
|
|
8
|
+
const { coalesce } = arrays;
|
|
9
|
+
|
|
10
|
+
@Injectable()
|
|
11
|
+
export class DebugExpressionProvider {
|
|
12
|
+
@Autowired(IEvaluatableExpressionService)
|
|
13
|
+
protected readonly evaluatableExpressionService: IEvaluatableExpressionService;
|
|
14
|
+
|
|
15
|
+
async get(model: ITextModel, selection: monaco.IRange): Promise<string | undefined> {
|
|
16
|
+
let matchingExpression: string | undefined;
|
|
17
|
+
let rng: IRange | undefined;
|
|
18
|
+
|
|
19
|
+
if (this.evaluatableExpressionService.hasEvaluatableExpressProvider(model)) {
|
|
20
|
+
const cancellationSource = new CancellationTokenSource();
|
|
21
|
+
const supports = this.evaluatableExpressionService.getSupportedEvaluatableExpressionProvider(model);
|
|
22
|
+
|
|
23
|
+
const pos = new monaco.Position(selection.startLineNumber, selection.startColumn);
|
|
24
|
+
|
|
25
|
+
const promises = supports.map((support) =>
|
|
26
|
+
Promise.resolve(support.provideEvaluatableExpression(model, pos, cancellationSource.token)).then(
|
|
27
|
+
(expression) => expression,
|
|
28
|
+
() => undefined,
|
|
29
|
+
),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const results = await Promise.all(promises).then(coalesce);
|
|
33
|
+
if (results.length > 0) {
|
|
34
|
+
matchingExpression = results[0]?.expression;
|
|
35
|
+
rng = results[0]?.range;
|
|
36
|
+
|
|
37
|
+
if (!matchingExpression && rng) {
|
|
38
|
+
const lineContent = model.getLineContent(pos.lineNumber);
|
|
39
|
+
matchingExpression = lineContent.substring(rng.startColumn - 1, rng.endColumn - 1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
const lineContent = model.getLineContent(selection.startLineNumber);
|
|
44
|
+
const { start, end } = this.getExactExpressionStartAndEnd(
|
|
45
|
+
lineContent,
|
|
46
|
+
selection.startColumn,
|
|
47
|
+
selection.endColumn,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
matchingExpression = lineContent.substring(start - 1, end);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return matchingExpression;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
protected getExactExpressionStartAndEnd(
|
|
57
|
+
lineContent: string,
|
|
58
|
+
looseStart: number,
|
|
59
|
+
looseEnd: number,
|
|
60
|
+
): { start: number; end: number } {
|
|
61
|
+
let matchingExpression: string | undefined;
|
|
62
|
+
let startOffset = 0;
|
|
63
|
+
|
|
64
|
+
// Some example supported expressions: myVar.prop, a.b.c.d, myVar?.prop, myVar->prop, MyClass::StaticProp, *myVar
|
|
65
|
+
// Match any character except a set of characters which often break interesting sub-expressions
|
|
66
|
+
const expression = /([^()[\]{}<>\s+\-/%~#^;=|,`!]|->)+/g;
|
|
67
|
+
let result: RegExpExecArray | null = null;
|
|
68
|
+
|
|
69
|
+
// First find the full expression under the cursor
|
|
70
|
+
while ((result = expression.exec(lineContent))) {
|
|
71
|
+
const start = result.index + 1;
|
|
72
|
+
const end = start + result[0].length;
|
|
73
|
+
|
|
74
|
+
if (start <= looseStart && end >= looseEnd) {
|
|
75
|
+
matchingExpression = result[0];
|
|
76
|
+
startOffset = start;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// If there are non-word characters after the cursor, we want to truncate the expression then.
|
|
82
|
+
// For example in expression 'a.b.c.d', if the focus was under 'b', 'a.b' would be evaluated.
|
|
83
|
+
if (matchingExpression) {
|
|
84
|
+
const subExpression = /\w+/g;
|
|
85
|
+
let subExpressionResult: RegExpExecArray | null = null;
|
|
86
|
+
while ((subExpressionResult = subExpression.exec(matchingExpression))) {
|
|
87
|
+
const subEnd = subExpressionResult.index + 1 + startOffset + subExpressionResult[0].length;
|
|
88
|
+
if (subEnd >= looseEnd) {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (subExpressionResult) {
|
|
94
|
+
matchingExpression = matchingExpression.substring(0, subExpression.lastIndex);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return matchingExpression
|
|
98
|
+
? { start: startOffset, end: startOffset + matchingExpression.length - 1 }
|
|
99
|
+
: { start: 0, end: 0 };
|
|
100
|
+
}
|
|
101
|
+
}
|