@codingame/monaco-vscode-debug-service-override 1.82.4 → 1.82.5-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/debug.d.ts +5 -0
- package/debug.js +24 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +2 -2
- package/vscode/src/vs/editor/common/services/languageFeaturesService.js +44 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +200 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +785 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +399 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1298 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +960 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +497 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +347 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +299 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +400 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +827 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +621 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +60 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +527 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +681 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +356 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +206 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +82 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +143 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +1174 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +1144 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +106 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +68 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +275 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +314 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +168 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +663 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +105 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +231 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +631 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +695 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +953 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +48 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +336 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +98 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +575 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +415 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +102 -0
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +21 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +17 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +100 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +59 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1482 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +346 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +123 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +175 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +36 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +117 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +260 -0
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +27 -0
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +83 -0
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +283 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +305 -0
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +28 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +176 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +12 -0
package/debug.d.ts
ADDED
package/debug.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
2
|
+
import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
3
|
+
import { DebugService } from './vscode/src/vs/workbench/contrib/debug/browser/debugService.js';
|
|
4
|
+
import { LanguageFeaturesService } from './vscode/src/vs/editor/common/services/languageFeaturesService.js';
|
|
5
|
+
import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
|
|
6
|
+
import { ConfigurationResolverService } from './vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js';
|
|
7
|
+
import { IConfigurationResolverService } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolver';
|
|
8
|
+
import getServiceOverride$1 from 'vscode/service-override/layout';
|
|
9
|
+
import './vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js';
|
|
10
|
+
|
|
11
|
+
const original = DebugService.prototype['showError'];
|
|
12
|
+
DebugService.prototype['showError'] = function (message, errorActions) {
|
|
13
|
+
return original.call(this, message, errorActions, false);
|
|
14
|
+
};
|
|
15
|
+
function getServiceOverride() {
|
|
16
|
+
return {
|
|
17
|
+
...getServiceOverride$1(),
|
|
18
|
+
[( ILanguageFeaturesService.toString())]: new SyncDescriptor(LanguageFeaturesService, [], true),
|
|
19
|
+
[( IDebugService.toString())]: new SyncDescriptor(DebugService, [], true),
|
|
20
|
+
[( IConfigurationResolverService.toString())]: new SyncDescriptor(ConfigurationResolverService, [], true)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { getServiceOverride as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2
|
+
|
|
3
|
+
export { n as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function __decorate(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
}
|
|
7
|
+
function __param(paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { __decorate, __param };
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from './debug.js';
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from './debug.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var ConfirmResult;
|
|
2
|
+
( (function(ConfirmResult) {
|
|
3
|
+
ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
|
|
4
|
+
ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
|
|
5
|
+
ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
|
|
6
|
+
})(ConfirmResult || (ConfirmResult = {})));
|
|
7
|
+
|
|
8
|
+
export { ConfirmResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-debug-service-override",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.5-next.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.82.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.82.5-next.1",
|
|
22
22
|
"monaco-editor": "0.43.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LanguageFeatureRegistry } from 'monaco-editor/esm/vs/editor/common/languageFeatureRegistry.js';
|
|
2
|
+
|
|
3
|
+
class LanguageFeaturesService {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.referenceProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
6
|
+
this.renameProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
7
|
+
this.codeActionProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
8
|
+
this.definitionProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
9
|
+
this.typeDefinitionProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
10
|
+
this.declarationProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
11
|
+
this.implementationProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
12
|
+
this.documentSymbolProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
13
|
+
this.inlayHintsProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
14
|
+
this.colorProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
15
|
+
this.codeLensProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
16
|
+
this.documentFormattingEditProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
17
|
+
this.documentRangeFormattingEditProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
18
|
+
this.onTypeFormattingEditProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
19
|
+
this.signatureHelpProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
20
|
+
this.hoverProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
21
|
+
this.documentHighlightProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
22
|
+
this.selectionRangeProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
23
|
+
this.foldingRangeProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
24
|
+
this.linkProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
25
|
+
this.inlineCompletionsProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
26
|
+
this.completionProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
27
|
+
this.linkedEditingRangeProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
28
|
+
this.inlineValuesProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
29
|
+
this.evaluatableExpressionProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
30
|
+
this.documentRangeSemanticTokensProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
31
|
+
this.documentSemanticTokensProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
32
|
+
this.documentOnDropEditProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
33
|
+
this.documentPasteEditProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
34
|
+
this.mappedEditsProvider = ( new LanguageFeatureRegistry(this._score.bind(this)));
|
|
35
|
+
}
|
|
36
|
+
setNotebookTypeResolver(resolver) {
|
|
37
|
+
this._notebookTypeResolver = resolver;
|
|
38
|
+
}
|
|
39
|
+
_score(uri) {
|
|
40
|
+
return this._notebookTypeResolver?.(uri);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { LanguageFeaturesService };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
|
|
4
|
+
import { HighlightedLabel } from 'monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js';
|
|
5
|
+
import { InputBox } from 'monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js';
|
|
6
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
7
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
8
|
+
import { createMatches } from 'monaco-editor/esm/vs/base/common/filters.js';
|
|
9
|
+
import { once } from 'monaco-editor/esm/vs/base/common/functional.js';
|
|
10
|
+
import { DisposableStore, dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
11
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
12
|
+
import { IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
13
|
+
import { defaultInputBoxStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
14
|
+
import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
15
|
+
import { Expression, Variable, ExpressionContainer } from '../common/debugModel.js';
|
|
16
|
+
import { ReplEvaluationResult } from '../common/replModel.js';
|
|
17
|
+
|
|
18
|
+
const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024;
|
|
19
|
+
const booleanRegex = /^(true|false)$/i;
|
|
20
|
+
const stringRegex = /^(['"]).*\1$/;
|
|
21
|
+
const $ = dom.$;
|
|
22
|
+
function renderViewTree(container) {
|
|
23
|
+
const treeContainer = $('.');
|
|
24
|
+
treeContainer.classList.add('debug-view-content');
|
|
25
|
+
container.appendChild(treeContainer);
|
|
26
|
+
return treeContainer;
|
|
27
|
+
}
|
|
28
|
+
function renderExpressionValue(expressionOrValue, container, options) {
|
|
29
|
+
let value = typeof expressionOrValue === 'string' ? expressionOrValue : expressionOrValue.value;
|
|
30
|
+
container.className = 'value';
|
|
31
|
+
if (value === null || ((expressionOrValue instanceof Expression || expressionOrValue instanceof Variable || expressionOrValue instanceof ReplEvaluationResult) && !expressionOrValue.available)) {
|
|
32
|
+
container.classList.add('unavailable');
|
|
33
|
+
if (value !== Expression.DEFAULT_VALUE) {
|
|
34
|
+
container.classList.add('error');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if ((expressionOrValue instanceof ExpressionContainer) && options.showChanged && expressionOrValue.valueChanged && value !== Expression.DEFAULT_VALUE) {
|
|
39
|
+
container.className = 'value changed';
|
|
40
|
+
expressionOrValue.valueChanged = false;
|
|
41
|
+
}
|
|
42
|
+
if (options.colorize && typeof expressionOrValue !== 'string') {
|
|
43
|
+
if (expressionOrValue.type === 'number' || expressionOrValue.type === 'boolean' || expressionOrValue.type === 'string') {
|
|
44
|
+
container.classList.add(expressionOrValue.type);
|
|
45
|
+
}
|
|
46
|
+
else if (!isNaN(+value)) {
|
|
47
|
+
container.classList.add('number');
|
|
48
|
+
}
|
|
49
|
+
else if (booleanRegex.test(value)) {
|
|
50
|
+
container.classList.add('boolean');
|
|
51
|
+
}
|
|
52
|
+
else if (stringRegex.test(value)) {
|
|
53
|
+
container.classList.add('string');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (options.maxValueLength && value && value.length > options.maxValueLength) {
|
|
58
|
+
value = value.substring(0, options.maxValueLength) + '...';
|
|
59
|
+
}
|
|
60
|
+
if (!value) {
|
|
61
|
+
value = '';
|
|
62
|
+
}
|
|
63
|
+
if (options.linkDetector) {
|
|
64
|
+
container.textContent = '';
|
|
65
|
+
const session = (expressionOrValue instanceof ExpressionContainer) ? expressionOrValue.getSession() : undefined;
|
|
66
|
+
container.appendChild(options.linkDetector.linkify(value, false, session ? session.root : undefined, true));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
container.textContent = value;
|
|
70
|
+
}
|
|
71
|
+
if (options.showHover) {
|
|
72
|
+
container.title = value || '';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function renderVariable(variable, data, showChanged, highlights, linkDetector) {
|
|
76
|
+
if (variable.available) {
|
|
77
|
+
let text = variable.name;
|
|
78
|
+
if (variable.value && typeof variable.name === 'string') {
|
|
79
|
+
text += ':';
|
|
80
|
+
}
|
|
81
|
+
data.label.set(text, highlights, variable.type ? variable.type : variable.name);
|
|
82
|
+
data.name.classList.toggle('virtual', variable.presentationHint?.kind === 'virtual');
|
|
83
|
+
data.name.classList.toggle('internal', variable.presentationHint?.visibility === 'internal');
|
|
84
|
+
}
|
|
85
|
+
else if (variable.value && typeof variable.name === 'string' && variable.name) {
|
|
86
|
+
data.label.set(':');
|
|
87
|
+
}
|
|
88
|
+
data.expression.classList.toggle('lazy', !!variable.presentationHint?.lazy);
|
|
89
|
+
renderExpressionValue(variable, data.value, {
|
|
90
|
+
showChanged,
|
|
91
|
+
maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET,
|
|
92
|
+
showHover: true,
|
|
93
|
+
colorize: true,
|
|
94
|
+
linkDetector
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
let AbstractExpressionsRenderer = class AbstractExpressionsRenderer {
|
|
98
|
+
constructor(debugService, contextViewService) {
|
|
99
|
+
this.debugService = debugService;
|
|
100
|
+
this.contextViewService = contextViewService;
|
|
101
|
+
}
|
|
102
|
+
renderTemplate(container) {
|
|
103
|
+
const expression = dom.append(container, $('.expression'));
|
|
104
|
+
const name = dom.append(expression, $('span.name'));
|
|
105
|
+
const lazyButton = dom.append(expression, $('span.lazy-button'));
|
|
106
|
+
lazyButton.classList.add(...ThemeIcon.asClassNameArray(Codicon.eye));
|
|
107
|
+
lazyButton.title = ( localize('debug.lazyButton.tooltip', "Click to expand"));
|
|
108
|
+
const value = dom.append(expression, $('span.value'));
|
|
109
|
+
const label = ( new HighlightedLabel(name));
|
|
110
|
+
const inputBoxContainer = dom.append(expression, $('.inputBoxContainer'));
|
|
111
|
+
const templateDisposable = ( new DisposableStore());
|
|
112
|
+
let actionBar;
|
|
113
|
+
if (this.renderActionBar) {
|
|
114
|
+
dom.append(expression, $('.span.actionbar-spacer'));
|
|
115
|
+
actionBar = templateDisposable.add(( new ActionBar(expression)));
|
|
116
|
+
}
|
|
117
|
+
const template = { expression, name, value, label, inputBoxContainer, actionBar, elementDisposable: [], templateDisposable, lazyButton, currentElement: undefined };
|
|
118
|
+
templateDisposable.add(dom.addDisposableListener(lazyButton, dom.EventType.CLICK, () => {
|
|
119
|
+
if (template.currentElement) {
|
|
120
|
+
this.debugService.getViewModel().evaluateLazyExpression(template.currentElement);
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
return template;
|
|
124
|
+
}
|
|
125
|
+
renderExpressionElement(element, node, data) {
|
|
126
|
+
data.currentElement = element;
|
|
127
|
+
this.renderExpression(node.element, data, createMatches(node.filterData));
|
|
128
|
+
if (data.actionBar) {
|
|
129
|
+
this.renderActionBar(data.actionBar, element, data);
|
|
130
|
+
}
|
|
131
|
+
const selectedExpression = this.debugService.getViewModel().getSelectedExpression();
|
|
132
|
+
if (element === selectedExpression?.expression || (element instanceof Variable && element.errorMessage)) {
|
|
133
|
+
const options = this.getInputBoxOptions(element, !!selectedExpression?.settingWatch);
|
|
134
|
+
if (options) {
|
|
135
|
+
data.elementDisposable.push(this.renderInputBox(data.name, data.value, data.inputBoxContainer, options));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
renderInputBox(nameElement, valueElement, inputBoxContainer, options) {
|
|
140
|
+
nameElement.style.display = 'none';
|
|
141
|
+
valueElement.style.display = 'none';
|
|
142
|
+
inputBoxContainer.style.display = 'initial';
|
|
143
|
+
dom.clearNode(inputBoxContainer);
|
|
144
|
+
const inputBox = ( new InputBox(
|
|
145
|
+
inputBoxContainer,
|
|
146
|
+
this.contextViewService,
|
|
147
|
+
{ ...options, inputBoxStyles: defaultInputBoxStyles }
|
|
148
|
+
));
|
|
149
|
+
inputBox.value = options.initialValue;
|
|
150
|
+
inputBox.focus();
|
|
151
|
+
inputBox.select();
|
|
152
|
+
const done = once((success, finishEditing) => {
|
|
153
|
+
nameElement.style.display = '';
|
|
154
|
+
valueElement.style.display = '';
|
|
155
|
+
inputBoxContainer.style.display = 'none';
|
|
156
|
+
const value = inputBox.value;
|
|
157
|
+
dispose(toDispose);
|
|
158
|
+
if (finishEditing) {
|
|
159
|
+
this.debugService.getViewModel().setSelectedExpression(undefined, false);
|
|
160
|
+
options.onFinish(value, success);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const toDispose = [
|
|
164
|
+
inputBox,
|
|
165
|
+
dom.addStandardDisposableListener(inputBox.inputElement, dom.EventType.KEY_DOWN, (e) => {
|
|
166
|
+
const isEscape = e.equals(9 );
|
|
167
|
+
const isEnter = e.equals(3 );
|
|
168
|
+
if (isEscape || isEnter) {
|
|
169
|
+
e.preventDefault();
|
|
170
|
+
e.stopPropagation();
|
|
171
|
+
done(isEnter, true);
|
|
172
|
+
}
|
|
173
|
+
}),
|
|
174
|
+
dom.addDisposableListener(inputBox.inputElement, dom.EventType.BLUR, () => {
|
|
175
|
+
done(true, true);
|
|
176
|
+
}),
|
|
177
|
+
dom.addDisposableListener(inputBox.inputElement, dom.EventType.CLICK, e => {
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
e.stopPropagation();
|
|
180
|
+
})
|
|
181
|
+
];
|
|
182
|
+
return toDisposable(() => {
|
|
183
|
+
done(false, false);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
disposeElement(node, index, templateData) {
|
|
187
|
+
dispose(templateData.elementDisposable);
|
|
188
|
+
templateData.elementDisposable = [];
|
|
189
|
+
}
|
|
190
|
+
disposeTemplate(templateData) {
|
|
191
|
+
dispose(templateData.elementDisposable);
|
|
192
|
+
templateData.templateDisposable.dispose();
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
AbstractExpressionsRenderer = ( __decorate([
|
|
196
|
+
( __param(0, IDebugService)),
|
|
197
|
+
( __param(1, IContextViewService))
|
|
198
|
+
], AbstractExpressionsRenderer));
|
|
199
|
+
|
|
200
|
+
export { AbstractExpressionsRenderer, renderExpressionValue, renderVariable, renderViewTree };
|