@codingame/monaco-vscode-debug-service-override 3.2.3 → 4.1.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.
Files changed (60) hide show
  1. package/debug.js +4 -4
  2. package/package.json +2 -2
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  6. package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +0 -73
  7. package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +0 -1011
  8. package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +0 -970
  9. package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +0 -347
  10. package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +0 -324
  11. package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +0 -432
  12. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +0 -1039
  13. package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +0 -649
  14. package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +0 -64
  15. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +0 -636
  16. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +0 -725
  17. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +0 -398
  18. package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +0 -206
  19. package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +0 -80
  20. package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +0 -169
  21. package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +0 -1271
  22. package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +0 -1305
  23. package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +0 -115
  24. package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +0 -77
  25. package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +0 -307
  26. package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +0 -31
  27. package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +0 -378
  28. package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +0 -267
  29. package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +0 -808
  30. package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +0 -121
  31. package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +0 -141
  32. package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +0 -262
  33. package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +0 -669
  34. package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +0 -6
  35. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +0 -6
  36. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +0 -6
  37. package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +0 -6
  38. package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +0 -6
  39. package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +0 -6
  40. package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +0 -709
  41. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +0 -992
  42. package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +0 -48
  43. package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +0 -348
  44. package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +0 -119
  45. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +0 -763
  46. package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +0 -501
  47. package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +0 -162
  48. package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +0 -21
  49. package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +0 -17
  50. package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +0 -110
  51. package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +0 -62
  52. package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +0 -460
  53. package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +0 -162
  54. package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +0 -36
  55. package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +0 -148
  56. package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +0 -289
  57. package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +0 -87
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +0 -64
  59. package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +0 -311
  60. package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +0 -28
@@ -1,162 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { URI } from 'vscode/vscode/vs/base/common/uri';
4
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
5
- import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
6
- import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
7
- import { Breakpoint, FunctionBreakpoint, ExceptionBreakpoint, DataBreakpoint, Expression } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
8
- import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles';
9
- import { observableValue } from 'vscode/vscode/vs/base/common/observableInternal/base';
10
-
11
- const DEBUG_BREAKPOINTS_KEY = 'debug.breakpoint';
12
- const DEBUG_FUNCTION_BREAKPOINTS_KEY = 'debug.functionbreakpoint';
13
- const DEBUG_DATA_BREAKPOINTS_KEY = 'debug.databreakpoint';
14
- const DEBUG_EXCEPTION_BREAKPOINTS_KEY = 'debug.exceptionbreakpoint';
15
- const DEBUG_WATCH_EXPRESSIONS_KEY = 'debug.watchexpressions';
16
- const DEBUG_CHOSEN_ENVIRONMENTS_KEY = 'debug.chosenenvironment';
17
- const DEBUG_UX_STATE_KEY = 'debug.uxstate';
18
- let DebugStorage = class DebugStorage extends Disposable {
19
- constructor(storageService, textFileService, uriIdentityService, logService) {
20
- super();
21
- this.storageService = storageService;
22
- this.textFileService = textFileService;
23
- this.uriIdentityService = uriIdentityService;
24
- this.logService = logService;
25
- this.breakpoints = observableValue(this, this.loadBreakpoints());
26
- this.functionBreakpoints = observableValue(this, this.loadFunctionBreakpoints());
27
- this.exceptionBreakpoints = observableValue(this, this.loadExceptionBreakpoints());
28
- this.dataBreakpoints = observableValue(this, this.loadDataBreakpoints());
29
- this.watchExpressions = observableValue(this, this.loadWatchExpressions());
30
- this._register(storageService.onDidChangeValue(1 , undefined, this._store)(e => {
31
- if (e.external) {
32
- switch (e.key) {
33
- case DEBUG_BREAKPOINTS_KEY:
34
- return this.breakpoints.set(this.loadBreakpoints(), undefined);
35
- case DEBUG_FUNCTION_BREAKPOINTS_KEY:
36
- return this.functionBreakpoints.set(this.loadFunctionBreakpoints(), undefined);
37
- case DEBUG_EXCEPTION_BREAKPOINTS_KEY:
38
- return this.exceptionBreakpoints.set(this.loadExceptionBreakpoints(), undefined);
39
- case DEBUG_DATA_BREAKPOINTS_KEY:
40
- return this.dataBreakpoints.set(this.loadDataBreakpoints(), undefined);
41
- case DEBUG_WATCH_EXPRESSIONS_KEY:
42
- return this.watchExpressions.set(this.loadWatchExpressions(), undefined);
43
- }
44
- }
45
- }));
46
- }
47
- loadDebugUxState() {
48
- return this.storageService.get(DEBUG_UX_STATE_KEY, 1 , 'default');
49
- }
50
- storeDebugUxState(value) {
51
- this.storageService.store(DEBUG_UX_STATE_KEY, value, 1 , 1 );
52
- }
53
- loadBreakpoints() {
54
- let result;
55
- try {
56
- result = ( JSON.parse(this.storageService.get(DEBUG_BREAKPOINTS_KEY, 1 , '[]')).map((breakpoint) => {
57
- breakpoint.uri = URI.revive(breakpoint.uri);
58
- return ( new Breakpoint(
59
- breakpoint,
60
- this.textFileService,
61
- this.uriIdentityService,
62
- this.logService,
63
- breakpoint.id
64
- ));
65
- }));
66
- }
67
- catch (e) { }
68
- return result || [];
69
- }
70
- loadFunctionBreakpoints() {
71
- let result;
72
- try {
73
- result = ( JSON.parse(this.storageService.get(DEBUG_FUNCTION_BREAKPOINTS_KEY, 1 , '[]')).map((fb) => {
74
- return ( new FunctionBreakpoint(fb, fb.id));
75
- }));
76
- }
77
- catch (e) { }
78
- return result || [];
79
- }
80
- loadExceptionBreakpoints() {
81
- let result;
82
- try {
83
- result = ( JSON.parse(this.storageService.get(DEBUG_EXCEPTION_BREAKPOINTS_KEY, 1 , '[]')).map((exBreakpoint) => {
84
- return ( new ExceptionBreakpoint(exBreakpoint, exBreakpoint.id));
85
- }));
86
- }
87
- catch (e) { }
88
- return result || [];
89
- }
90
- loadDataBreakpoints() {
91
- let result;
92
- try {
93
- result = ( JSON.parse(this.storageService.get(DEBUG_DATA_BREAKPOINTS_KEY, 1 , '[]')).map((dbp) => {
94
- return ( new DataBreakpoint(dbp, dbp.id));
95
- }));
96
- }
97
- catch (e) { }
98
- return result || [];
99
- }
100
- loadWatchExpressions() {
101
- let result;
102
- try {
103
- result = ( JSON.parse(this.storageService.get(DEBUG_WATCH_EXPRESSIONS_KEY, 1 , '[]')).map((watchStoredData) => {
104
- return ( new Expression(watchStoredData.name, watchStoredData.id));
105
- }));
106
- }
107
- catch (e) { }
108
- return result || [];
109
- }
110
- loadChosenEnvironments() {
111
- return JSON.parse(this.storageService.get(DEBUG_CHOSEN_ENVIRONMENTS_KEY, 1 , '{}'));
112
- }
113
- storeChosenEnvironments(environments) {
114
- this.storageService.store(DEBUG_CHOSEN_ENVIRONMENTS_KEY, JSON.stringify(environments), 1 , 1 );
115
- }
116
- storeWatchExpressions(watchExpressions) {
117
- if (watchExpressions.length) {
118
- this.storageService.store(DEBUG_WATCH_EXPRESSIONS_KEY, JSON.stringify(( watchExpressions.map(we => ({ name: we.name, id: we.getId() })))), 1 , 1 );
119
- }
120
- else {
121
- this.storageService.remove(DEBUG_WATCH_EXPRESSIONS_KEY, 1 );
122
- }
123
- }
124
- storeBreakpoints(debugModel) {
125
- const breakpoints = debugModel.getBreakpoints();
126
- if (breakpoints.length) {
127
- this.storageService.store(DEBUG_BREAKPOINTS_KEY, JSON.stringify(breakpoints), 1 , 1 );
128
- }
129
- else {
130
- this.storageService.remove(DEBUG_BREAKPOINTS_KEY, 1 );
131
- }
132
- const functionBreakpoints = debugModel.getFunctionBreakpoints();
133
- if (functionBreakpoints.length) {
134
- this.storageService.store(DEBUG_FUNCTION_BREAKPOINTS_KEY, JSON.stringify(functionBreakpoints), 1 , 1 );
135
- }
136
- else {
137
- this.storageService.remove(DEBUG_FUNCTION_BREAKPOINTS_KEY, 1 );
138
- }
139
- const dataBreakpoints = debugModel.getDataBreakpoints().filter(dbp => dbp.canPersist);
140
- if (dataBreakpoints.length) {
141
- this.storageService.store(DEBUG_DATA_BREAKPOINTS_KEY, JSON.stringify(dataBreakpoints), 1 , 1 );
142
- }
143
- else {
144
- this.storageService.remove(DEBUG_DATA_BREAKPOINTS_KEY, 1 );
145
- }
146
- const exceptionBreakpoints = debugModel.getExceptionBreakpoints();
147
- if (exceptionBreakpoints.length) {
148
- this.storageService.store(DEBUG_EXCEPTION_BREAKPOINTS_KEY, JSON.stringify(exceptionBreakpoints), 1 , 1 );
149
- }
150
- else {
151
- this.storageService.remove(DEBUG_EXCEPTION_BREAKPOINTS_KEY, 1 );
152
- }
153
- }
154
- };
155
- DebugStorage = ( __decorate([
156
- ( __param(0, IStorageService)),
157
- ( __param(1, ITextFileService)),
158
- ( __param(2, IUriIdentityService)),
159
- ( __param(3, ILogService))
160
- ], DebugStorage));
161
-
162
- export { DebugStorage };
@@ -1,36 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
3
-
4
- let DebugTelemetry = class DebugTelemetry {
5
- constructor(model, telemetryService) {
6
- this.model = model;
7
- this.telemetryService = telemetryService;
8
- }
9
- logDebugSessionStart(dbgr, launchJsonExists) {
10
- const extension = dbgr.getMainExtensionDescriptor();
11
- this.telemetryService.publicLog('debugSessionStart', {
12
- type: dbgr.type,
13
- breakpointCount: this.model.getBreakpoints().length,
14
- exceptionBreakpoints: this.model.getExceptionBreakpoints(),
15
- watchExpressionsCount: this.model.getWatchExpressions().length,
16
- extensionName: extension.identifier.value,
17
- isBuiltin: extension.isBuiltin,
18
- launchJsonExists
19
- });
20
- }
21
- logDebugSessionStop(session, adapterExitEvent) {
22
- const breakpoints = this.model.getBreakpoints();
23
- this.telemetryService.publicLog('debugSessionStop', {
24
- type: session && session.configuration.type,
25
- success: adapterExitEvent.emittedStopped || breakpoints.length === 0,
26
- sessionLengthInSeconds: adapterExitEvent.sessionLengthInSeconds,
27
- breakpointCount: breakpoints.length,
28
- watchExpressionsCount: this.model.getWatchExpressions().length
29
- });
30
- }
31
- };
32
- DebugTelemetry = ( __decorate([
33
- ( __param(1, ITelemetryService))
34
- ], DebugTelemetry));
35
-
36
- export { DebugTelemetry };
@@ -1,148 +0,0 @@
1
- import { Emitter } from 'vscode/vscode/vs/base/common/event';
2
- import { CONTEXT_EXPRESSION_SELECTED, CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG, CONTEXT_RESTART_FRAME_SUPPORTED, CONTEXT_STEP_INTO_TARGETS_SUPPORTED, CONTEXT_JUMP_TO_CURSOR_SUPPORTED, CONTEXT_SET_VARIABLE_SUPPORTED, CONTEXT_SET_EXPRESSION_SUPPORTED, CONTEXT_MULTI_SESSION_DEBUG, CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED, CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED, CONTEXT_DISASSEMBLE_REQUEST_SUPPORTED, CONTEXT_FOCUSED_STACK_FRAME_HAS_INSTRUCTION_POINTER_REFERENCE } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
3
- import { isSessionAttach } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
4
-
5
- class ViewModel {
6
- constructor(contextKeyService) {
7
- this.contextKeyService = contextKeyService;
8
- this.firstSessionStart = true;
9
- this._onDidFocusSession = ( new Emitter());
10
- this._onDidFocusThread = ( new Emitter());
11
- this._onDidFocusStackFrame = ( new Emitter());
12
- this._onDidSelectExpression = ( new Emitter());
13
- this._onDidEvaluateLazyExpression = ( new Emitter());
14
- this._onWillUpdateViews = ( new Emitter());
15
- this._onDidChangeVisualization = ( new Emitter());
16
- this.visualized = ( new WeakMap());
17
- this.preferredVisualizers = ( new Map());
18
- contextKeyService.bufferChangeEvents(() => {
19
- this.expressionSelectedContextKey = CONTEXT_EXPRESSION_SELECTED.bindTo(contextKeyService);
20
- this.loadedScriptsSupportedContextKey = CONTEXT_LOADED_SCRIPTS_SUPPORTED.bindTo(contextKeyService);
21
- this.stepBackSupportedContextKey = CONTEXT_STEP_BACK_SUPPORTED.bindTo(contextKeyService);
22
- this.focusedSessionIsAttach = CONTEXT_FOCUSED_SESSION_IS_ATTACH.bindTo(contextKeyService);
23
- this.focusedSessionIsNoDebug = CONTEXT_FOCUSED_SESSION_IS_NO_DEBUG.bindTo(contextKeyService);
24
- this.restartFrameSupportedContextKey = CONTEXT_RESTART_FRAME_SUPPORTED.bindTo(contextKeyService);
25
- this.stepIntoTargetsSupported = CONTEXT_STEP_INTO_TARGETS_SUPPORTED.bindTo(contextKeyService);
26
- this.jumpToCursorSupported = CONTEXT_JUMP_TO_CURSOR_SUPPORTED.bindTo(contextKeyService);
27
- this.setVariableSupported = CONTEXT_SET_VARIABLE_SUPPORTED.bindTo(contextKeyService);
28
- this.setExpressionSupported = CONTEXT_SET_EXPRESSION_SUPPORTED.bindTo(contextKeyService);
29
- this.multiSessionDebug = CONTEXT_MULTI_SESSION_DEBUG.bindTo(contextKeyService);
30
- this.terminateDebuggeeSupported = CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED.bindTo(contextKeyService);
31
- this.suspendDebuggeeSupported = CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED.bindTo(contextKeyService);
32
- this.disassembleRequestSupported = CONTEXT_DISASSEMBLE_REQUEST_SUPPORTED.bindTo(contextKeyService);
33
- this.focusedStackFrameHasInstructionPointerReference = CONTEXT_FOCUSED_STACK_FRAME_HAS_INSTRUCTION_POINTER_REFERENCE.bindTo(contextKeyService);
34
- });
35
- }
36
- getId() {
37
- return 'root';
38
- }
39
- get focusedSession() {
40
- return this._focusedSession;
41
- }
42
- get focusedThread() {
43
- return this._focusedThread;
44
- }
45
- get focusedStackFrame() {
46
- return this._focusedStackFrame;
47
- }
48
- setFocus(stackFrame, thread, session, explicit) {
49
- const shouldEmitForStackFrame = this._focusedStackFrame !== stackFrame;
50
- const shouldEmitForSession = this._focusedSession !== session;
51
- const shouldEmitForThread = this._focusedThread !== thread;
52
- this._focusedStackFrame = stackFrame;
53
- this._focusedThread = thread;
54
- this._focusedSession = session;
55
- this.contextKeyService.bufferChangeEvents(() => {
56
- this.loadedScriptsSupportedContextKey.set(session ? !!session.capabilities.supportsLoadedSourcesRequest : false);
57
- this.stepBackSupportedContextKey.set(session ? !!session.capabilities.supportsStepBack : false);
58
- this.restartFrameSupportedContextKey.set(session ? !!session.capabilities.supportsRestartFrame : false);
59
- this.stepIntoTargetsSupported.set(session ? !!session.capabilities.supportsStepInTargetsRequest : false);
60
- this.jumpToCursorSupported.set(session ? !!session.capabilities.supportsGotoTargetsRequest : false);
61
- this.setVariableSupported.set(session ? !!session.capabilities.supportsSetVariable : false);
62
- this.setExpressionSupported.set(session ? !!session.capabilities.supportsSetExpression : false);
63
- this.terminateDebuggeeSupported.set(session ? !!session.capabilities.supportTerminateDebuggee : false);
64
- this.suspendDebuggeeSupported.set(session ? !!session.capabilities.supportSuspendDebuggee : false);
65
- this.disassembleRequestSupported.set(!!session?.capabilities.supportsDisassembleRequest);
66
- this.focusedStackFrameHasInstructionPointerReference.set(!!stackFrame?.instructionPointerReference);
67
- const attach = !!session && isSessionAttach(session);
68
- this.focusedSessionIsAttach.set(attach);
69
- this.focusedSessionIsNoDebug.set(!!session && !!session.configuration.noDebug);
70
- });
71
- if (shouldEmitForSession) {
72
- this._onDidFocusSession.fire(session);
73
- }
74
- if (shouldEmitForStackFrame) {
75
- this._onDidFocusStackFrame.fire({ stackFrame, explicit, session });
76
- }
77
- else if (shouldEmitForThread) {
78
- this._onDidFocusThread.fire({ thread, explicit, session });
79
- }
80
- }
81
- get onDidFocusSession() {
82
- return this._onDidFocusSession.event;
83
- }
84
- get onDidFocusThread() {
85
- return this._onDidFocusThread.event;
86
- }
87
- get onDidFocusStackFrame() {
88
- return this._onDidFocusStackFrame.event;
89
- }
90
- get onDidChangeVisualization() {
91
- return this._onDidChangeVisualization.event;
92
- }
93
- getSelectedExpression() {
94
- return this.selectedExpression;
95
- }
96
- setSelectedExpression(expression, settingWatch) {
97
- this.selectedExpression = expression ? { expression, settingWatch: settingWatch } : undefined;
98
- this.expressionSelectedContextKey.set(!!expression);
99
- this._onDidSelectExpression.fire(this.selectedExpression);
100
- }
101
- get onDidSelectExpression() {
102
- return this._onDidSelectExpression.event;
103
- }
104
- get onDidEvaluateLazyExpression() {
105
- return this._onDidEvaluateLazyExpression.event;
106
- }
107
- updateViews() {
108
- this._onWillUpdateViews.fire();
109
- }
110
- get onWillUpdateViews() {
111
- return this._onWillUpdateViews.event;
112
- }
113
- isMultiSessionView() {
114
- return !!this.multiSessionDebug.get();
115
- }
116
- setMultiSessionView(isMultiSessionView) {
117
- this.multiSessionDebug.set(isMultiSessionView);
118
- }
119
- setVisualizedExpression(original, visualized) {
120
- const current = this.visualized.get(original) || original;
121
- const key = this.getPreferredVisualizedKey(original);
122
- if (visualized) {
123
- this.visualized.set(original, visualized);
124
- this.preferredVisualizers.set(key, visualized.treeId);
125
- }
126
- else {
127
- this.visualized.delete(original);
128
- this.preferredVisualizers.delete(key);
129
- }
130
- this._onDidChangeVisualization.fire({ original: current, replacement: visualized || original });
131
- }
132
- getVisualizedExpression(expression) {
133
- return this.visualized.get(expression) || this.preferredVisualizers.get(this.getPreferredVisualizedKey(expression));
134
- }
135
- async evaluateLazyExpression(expression) {
136
- await expression.evaluateLazy();
137
- this._onDidEvaluateLazyExpression.fire(expression);
138
- }
139
- getPreferredVisualizedKey(expr) {
140
- return JSON.stringify([
141
- expr.name,
142
- expr.type,
143
- !!expr.memoryReference,
144
- ].join('\0'));
145
- }
146
- }
147
-
148
- export { ViewModel };
@@ -1,289 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { isObject } from 'vscode/vscode/vs/base/common/types';
4
- import { DebugConfigurationProviderTriggerKind, debuggerDisabledMessage, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
5
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
6
- import { IConfigurationResolverService } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolver';
7
- import { applyDeprecatedVariableMessage } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolverUtils';
8
- import { ITextResourcePropertiesService } from 'vscode/vscode/vs/editor/common/services/textResourceConfiguration';
9
- import { URI } from 'vscode/vscode/vs/base/common/uri';
10
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
11
- import { isDebuggerMainContribution } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
12
- import { cleanRemoteAuthority } from 'vscode/vscode/vs/platform/telemetry/common/telemetryUtils';
13
- import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
14
- import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
15
- import { filter } from 'vscode/vscode/vs/base/common/objects';
16
-
17
- let Debugger = class Debugger {
18
- constructor(adapterManager, dbgContribution, extensionDescription, configurationService, resourcePropertiesService, configurationResolverService, environmentService, debugService, contextKeyService) {
19
- this.adapterManager = adapterManager;
20
- this.configurationService = configurationService;
21
- this.resourcePropertiesService = resourcePropertiesService;
22
- this.configurationResolverService = configurationResolverService;
23
- this.environmentService = environmentService;
24
- this.debugService = debugService;
25
- this.contextKeyService = contextKeyService;
26
- this.mergedExtensionDescriptions = [];
27
- this.debuggerContribution = { type: dbgContribution.type };
28
- this.merge(dbgContribution, extensionDescription);
29
- this.debuggerWhen = typeof this.debuggerContribution.when === 'string' ? ContextKeyExpr.deserialize(this.debuggerContribution.when) : undefined;
30
- this.debuggerHiddenWhen = typeof this.debuggerContribution.hiddenWhen === 'string' ? ContextKeyExpr.deserialize(this.debuggerContribution.hiddenWhen) : undefined;
31
- }
32
- merge(otherDebuggerContribution, extensionDescription) {
33
- function mixin(destination, source, overwrite, level = 0) {
34
- if (!isObject(destination)) {
35
- return source;
36
- }
37
- if (isObject(source)) {
38
- ( Object.keys(source)).forEach(key => {
39
- if (key !== '__proto__') {
40
- if (isObject(destination[key]) && isObject(source[key])) {
41
- mixin(destination[key], source[key], overwrite, level + 1);
42
- }
43
- else {
44
- if (key in destination) {
45
- if (overwrite) {
46
- if (level === 0 && key === 'type') ;
47
- else {
48
- destination[key] = source[key];
49
- }
50
- }
51
- }
52
- else {
53
- destination[key] = source[key];
54
- }
55
- }
56
- }
57
- });
58
- }
59
- return destination;
60
- }
61
- if (this.mergedExtensionDescriptions.indexOf(extensionDescription) < 0) {
62
- this.mergedExtensionDescriptions.push(extensionDescription);
63
- mixin(this.debuggerContribution, otherDebuggerContribution, extensionDescription.isBuiltin);
64
- if (isDebuggerMainContribution(otherDebuggerContribution)) {
65
- this.mainExtensionDescription = extensionDescription;
66
- }
67
- }
68
- }
69
- async startDebugging(configuration, parentSessionId) {
70
- const parentSession = this.debugService.getModel().getSession(parentSessionId);
71
- return await this.debugService.startDebugging(undefined, configuration, { parentSession }, undefined);
72
- }
73
- async createDebugAdapter(session) {
74
- await this.adapterManager.activateDebuggers('onDebugAdapterProtocolTracker', this.type);
75
- const da = this.adapterManager.createDebugAdapter(session);
76
- if (da) {
77
- return Promise.resolve(da);
78
- }
79
- throw new Error(localizeWithPath('vs/workbench/contrib/debug/common/debugger', 'cannot.find.da', "Cannot find debug adapter for type '{0}'.", this.type));
80
- }
81
- async substituteVariables(folder, config) {
82
- const substitutedConfig = await this.adapterManager.substituteVariables(this.type, folder, config);
83
- return await this.configurationResolverService.resolveWithInteractionReplace(folder, substitutedConfig, 'launch', this.variables, substitutedConfig.__configurationTarget);
84
- }
85
- runInTerminal(args, sessionId) {
86
- return this.adapterManager.runInTerminal(this.type, args, sessionId);
87
- }
88
- get label() {
89
- return this.debuggerContribution.label || this.debuggerContribution.type;
90
- }
91
- get type() {
92
- return this.debuggerContribution.type;
93
- }
94
- get variables() {
95
- return this.debuggerContribution.variables;
96
- }
97
- get configurationSnippets() {
98
- return this.debuggerContribution.configurationSnippets;
99
- }
100
- get languages() {
101
- return this.debuggerContribution.languages;
102
- }
103
- get when() {
104
- return this.debuggerWhen;
105
- }
106
- get hiddenWhen() {
107
- return this.debuggerHiddenWhen;
108
- }
109
- get enabled() {
110
- return !this.debuggerWhen || this.contextKeyService.contextMatchesRules(this.debuggerWhen);
111
- }
112
- get isHiddenFromDropdown() {
113
- if (!this.debuggerHiddenWhen) {
114
- return false;
115
- }
116
- return this.contextKeyService.contextMatchesRules(this.debuggerHiddenWhen);
117
- }
118
- get strings() {
119
- return this.debuggerContribution.strings ?? this.debuggerContribution.uiMessages;
120
- }
121
- interestedInLanguage(languageId) {
122
- return !!(this.languages && this.languages.indexOf(languageId) >= 0);
123
- }
124
- hasInitialConfiguration() {
125
- return !!this.debuggerContribution.initialConfigurations;
126
- }
127
- hasDynamicConfigurationProviders() {
128
- return this.debugService.getConfigurationManager().hasDebugConfigurationProvider(this.type, DebugConfigurationProviderTriggerKind.Dynamic);
129
- }
130
- hasConfigurationProvider() {
131
- return this.debugService.getConfigurationManager().hasDebugConfigurationProvider(this.type);
132
- }
133
- getInitialConfigurationContent(initialConfigs) {
134
- let initialConfigurations = this.debuggerContribution.initialConfigurations || [];
135
- if (initialConfigs) {
136
- initialConfigurations = initialConfigurations.concat(initialConfigs);
137
- }
138
- const eol = this.resourcePropertiesService.getEOL(( URI.from({ scheme: Schemas.untitled, path: '1' }))) === '\r\n' ? '\r\n' : '\n';
139
- const configs = ( JSON.stringify(initialConfigurations, null, '\t').split('\n').map(line => '\t' + line)).join(eol).trim();
140
- const comment1 = ( localizeWithPath(
141
- 'vs/workbench/contrib/debug/common/debugger',
142
- 'launch.config.comment1',
143
- "Use IntelliSense to learn about possible attributes."
144
- ));
145
- const comment2 = ( localizeWithPath(
146
- 'vs/workbench/contrib/debug/common/debugger',
147
- 'launch.config.comment2',
148
- "Hover to view descriptions of existing attributes."
149
- ));
150
- const comment3 = ( localizeWithPath(
151
- 'vs/workbench/contrib/debug/common/debugger',
152
- 'launch.config.comment3',
153
- "For more information, visit: {0}",
154
- 'https://go.microsoft.com/fwlink/?linkid=830387'
155
- ));
156
- let content = [
157
- '{',
158
- `\t// ${comment1}`,
159
- `\t// ${comment2}`,
160
- `\t// ${comment3}`,
161
- `\t"version": "0.2.0",`,
162
- `\t"configurations": ${configs}`,
163
- '}'
164
- ].join(eol);
165
- const editorConfig = this.configurationService.getValue();
166
- if (editorConfig.editor && editorConfig.editor.insertSpaces) {
167
- content = content.replace(( new RegExp('\t', 'g')), ' '.repeat(editorConfig.editor.tabSize));
168
- }
169
- return Promise.resolve(content);
170
- }
171
- getMainExtensionDescriptor() {
172
- return this.mainExtensionDescription || this.mergedExtensionDescriptions[0];
173
- }
174
- getCustomTelemetryEndpoint() {
175
- const aiKey = this.debuggerContribution.aiKey;
176
- if (!aiKey) {
177
- return undefined;
178
- }
179
- const sendErrorTelemtry = cleanRemoteAuthority(this.environmentService.remoteAuthority) !== 'other';
180
- return {
181
- id: `${this.getMainExtensionDescriptor().publisher}.${this.type}`,
182
- aiKey,
183
- sendErrorTelemetry: sendErrorTelemtry
184
- };
185
- }
186
- getSchemaAttributes(definitions) {
187
- if (!this.debuggerContribution.configurationAttributes) {
188
- return null;
189
- }
190
- return ( ( Object.keys(this.debuggerContribution.configurationAttributes)).map(request => {
191
- const definitionId = `${this.type}:${request}`;
192
- const platformSpecificDefinitionId = `${this.type}:${request}:platform`;
193
- const attributes = this.debuggerContribution.configurationAttributes[request];
194
- const defaultRequired = ['name', 'type', 'request'];
195
- attributes.required = attributes.required && attributes.required.length ? defaultRequired.concat(attributes.required) : defaultRequired;
196
- attributes.additionalProperties = false;
197
- attributes.type = 'object';
198
- if (!attributes.properties) {
199
- attributes.properties = {};
200
- }
201
- const properties = attributes.properties;
202
- properties['type'] = {
203
- enum: [this.type],
204
- enumDescriptions: [this.label],
205
- description: ( localizeWithPath(
206
- 'vs/workbench/contrib/debug/common/debugger',
207
- 'debugType',
208
- "Type of configuration."
209
- )),
210
- pattern: '^(?!node2)',
211
- deprecationMessage: this.debuggerContribution.deprecated || (this.enabled ? undefined : debuggerDisabledMessage(this.type)),
212
- doNotSuggest: !!this.debuggerContribution.deprecated,
213
- errorMessage: ( localizeWithPath(
214
- 'vs/workbench/contrib/debug/common/debugger',
215
- 'debugTypeNotRecognised',
216
- "The debug type is not recognized. Make sure that you have a corresponding debug extension installed and that it is enabled."
217
- )),
218
- patternErrorMessage: ( localizeWithPath(
219
- 'vs/workbench/contrib/debug/common/debugger',
220
- 'node2NotSupported',
221
- "\"node2\" is no longer supported, use \"node\" instead and set the \"protocol\" attribute to \"inspector\"."
222
- ))
223
- };
224
- properties['request'] = {
225
- enum: [request],
226
- description: ( localizeWithPath(
227
- 'vs/workbench/contrib/debug/common/debugger',
228
- 'debugRequest',
229
- "Request type of configuration. Can be \"launch\" or \"attach\"."
230
- )),
231
- };
232
- for (const prop in definitions['common'].properties) {
233
- properties[prop] = {
234
- $ref: `#/definitions/common/properties/${prop}`
235
- };
236
- }
237
- ( Object.keys(properties)).forEach(name => {
238
- applyDeprecatedVariableMessage(properties[name]);
239
- });
240
- definitions[definitionId] = { ...attributes };
241
- definitions[platformSpecificDefinitionId] = {
242
- type: 'object',
243
- additionalProperties: false,
244
- properties: filter(properties, key => key !== 'type' && key !== 'request' && key !== 'name')
245
- };
246
- const attributesCopy = { ...attributes };
247
- attributesCopy.properties = {
248
- ...properties,
249
- ...{
250
- windows: {
251
- $ref: `#/definitions/${platformSpecificDefinitionId}`,
252
- description: ( localizeWithPath(
253
- 'vs/workbench/contrib/debug/common/debugger',
254
- 'debugWindowsConfiguration',
255
- "Windows specific launch configuration attributes."
256
- )),
257
- },
258
- osx: {
259
- $ref: `#/definitions/${platformSpecificDefinitionId}`,
260
- description: ( localizeWithPath(
261
- 'vs/workbench/contrib/debug/common/debugger',
262
- 'debugOSXConfiguration',
263
- "OS X specific launch configuration attributes."
264
- )),
265
- },
266
- linux: {
267
- $ref: `#/definitions/${platformSpecificDefinitionId}`,
268
- description: ( localizeWithPath(
269
- 'vs/workbench/contrib/debug/common/debugger',
270
- 'debugLinuxConfiguration',
271
- "Linux specific launch configuration attributes."
272
- )),
273
- }
274
- }
275
- };
276
- return attributesCopy;
277
- }));
278
- }
279
- };
280
- Debugger = ( __decorate([
281
- ( __param(3, IConfigurationService)),
282
- ( __param(4, ITextResourcePropertiesService)),
283
- ( __param(5, IConfigurationResolverService)),
284
- ( __param(6, IWorkbenchEnvironmentService)),
285
- ( __param(7, IDebugService)),
286
- ( __param(8, IContextKeyService))
287
- ], Debugger));
288
-
289
- export { Debugger };