@codingame/monaco-vscode-debug-service-override 1.82.4 → 1.82.5-next.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/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
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
2
|
+
import { CONTEXT_EXPRESSION_SELECTED, CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_FOCUSED_SESSION_IS_ATTACH, 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
|
+
contextKeyService.bufferChangeEvents(() => {
|
|
16
|
+
this.expressionSelectedContextKey = CONTEXT_EXPRESSION_SELECTED.bindTo(contextKeyService);
|
|
17
|
+
this.loadedScriptsSupportedContextKey = CONTEXT_LOADED_SCRIPTS_SUPPORTED.bindTo(contextKeyService);
|
|
18
|
+
this.stepBackSupportedContextKey = CONTEXT_STEP_BACK_SUPPORTED.bindTo(contextKeyService);
|
|
19
|
+
this.focusedSessionIsAttach = CONTEXT_FOCUSED_SESSION_IS_ATTACH.bindTo(contextKeyService);
|
|
20
|
+
this.restartFrameSupportedContextKey = CONTEXT_RESTART_FRAME_SUPPORTED.bindTo(contextKeyService);
|
|
21
|
+
this.stepIntoTargetsSupported = CONTEXT_STEP_INTO_TARGETS_SUPPORTED.bindTo(contextKeyService);
|
|
22
|
+
this.jumpToCursorSupported = CONTEXT_JUMP_TO_CURSOR_SUPPORTED.bindTo(contextKeyService);
|
|
23
|
+
this.setVariableSupported = CONTEXT_SET_VARIABLE_SUPPORTED.bindTo(contextKeyService);
|
|
24
|
+
this.setExpressionSupported = CONTEXT_SET_EXPRESSION_SUPPORTED.bindTo(contextKeyService);
|
|
25
|
+
this.multiSessionDebug = CONTEXT_MULTI_SESSION_DEBUG.bindTo(contextKeyService);
|
|
26
|
+
this.terminateDebuggeeSupported = CONTEXT_TERMINATE_DEBUGGEE_SUPPORTED.bindTo(contextKeyService);
|
|
27
|
+
this.suspendDebuggeeSupported = CONTEXT_SUSPEND_DEBUGGEE_SUPPORTED.bindTo(contextKeyService);
|
|
28
|
+
this.disassembleRequestSupported = CONTEXT_DISASSEMBLE_REQUEST_SUPPORTED.bindTo(contextKeyService);
|
|
29
|
+
this.focusedStackFrameHasInstructionPointerReference = CONTEXT_FOCUSED_STACK_FRAME_HAS_INSTRUCTION_POINTER_REFERENCE.bindTo(contextKeyService);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
getId() {
|
|
33
|
+
return 'root';
|
|
34
|
+
}
|
|
35
|
+
get focusedSession() {
|
|
36
|
+
return this._focusedSession;
|
|
37
|
+
}
|
|
38
|
+
get focusedThread() {
|
|
39
|
+
return this._focusedThread;
|
|
40
|
+
}
|
|
41
|
+
get focusedStackFrame() {
|
|
42
|
+
return this._focusedStackFrame;
|
|
43
|
+
}
|
|
44
|
+
setFocus(stackFrame, thread, session, explicit) {
|
|
45
|
+
const shouldEmitForStackFrame = this._focusedStackFrame !== stackFrame;
|
|
46
|
+
const shouldEmitForSession = this._focusedSession !== session;
|
|
47
|
+
const shouldEmitForThread = this._focusedThread !== thread;
|
|
48
|
+
this._focusedStackFrame = stackFrame;
|
|
49
|
+
this._focusedThread = thread;
|
|
50
|
+
this._focusedSession = session;
|
|
51
|
+
this.contextKeyService.bufferChangeEvents(() => {
|
|
52
|
+
this.loadedScriptsSupportedContextKey.set(session ? !!session.capabilities.supportsLoadedSourcesRequest : false);
|
|
53
|
+
this.stepBackSupportedContextKey.set(session ? !!session.capabilities.supportsStepBack : false);
|
|
54
|
+
this.restartFrameSupportedContextKey.set(session ? !!session.capabilities.supportsRestartFrame : false);
|
|
55
|
+
this.stepIntoTargetsSupported.set(session ? !!session.capabilities.supportsStepInTargetsRequest : false);
|
|
56
|
+
this.jumpToCursorSupported.set(session ? !!session.capabilities.supportsGotoTargetsRequest : false);
|
|
57
|
+
this.setVariableSupported.set(session ? !!session.capabilities.supportsSetVariable : false);
|
|
58
|
+
this.setExpressionSupported.set(session ? !!session.capabilities.supportsSetExpression : false);
|
|
59
|
+
this.terminateDebuggeeSupported.set(session ? !!session.capabilities.supportTerminateDebuggee : false);
|
|
60
|
+
this.suspendDebuggeeSupported.set(session ? !!session.capabilities.supportSuspendDebuggee : false);
|
|
61
|
+
this.disassembleRequestSupported.set(!!session?.capabilities.supportsDisassembleRequest);
|
|
62
|
+
this.focusedStackFrameHasInstructionPointerReference.set(!!stackFrame?.instructionPointerReference);
|
|
63
|
+
const attach = !!session && isSessionAttach(session);
|
|
64
|
+
this.focusedSessionIsAttach.set(attach);
|
|
65
|
+
});
|
|
66
|
+
if (shouldEmitForSession) {
|
|
67
|
+
this._onDidFocusSession.fire(session);
|
|
68
|
+
}
|
|
69
|
+
if (shouldEmitForStackFrame) {
|
|
70
|
+
this._onDidFocusStackFrame.fire({ stackFrame, explicit, session });
|
|
71
|
+
}
|
|
72
|
+
else if (shouldEmitForThread) {
|
|
73
|
+
this._onDidFocusThread.fire({ thread, explicit, session });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
get onDidFocusSession() {
|
|
77
|
+
return this._onDidFocusSession.event;
|
|
78
|
+
}
|
|
79
|
+
get onDidFocusThread() {
|
|
80
|
+
return this._onDidFocusThread.event;
|
|
81
|
+
}
|
|
82
|
+
get onDidFocusStackFrame() {
|
|
83
|
+
return this._onDidFocusStackFrame.event;
|
|
84
|
+
}
|
|
85
|
+
getSelectedExpression() {
|
|
86
|
+
return this.selectedExpression;
|
|
87
|
+
}
|
|
88
|
+
setSelectedExpression(expression, settingWatch) {
|
|
89
|
+
this.selectedExpression = expression ? { expression, settingWatch: settingWatch } : undefined;
|
|
90
|
+
this.expressionSelectedContextKey.set(!!expression);
|
|
91
|
+
this._onDidSelectExpression.fire(this.selectedExpression);
|
|
92
|
+
}
|
|
93
|
+
get onDidSelectExpression() {
|
|
94
|
+
return this._onDidSelectExpression.event;
|
|
95
|
+
}
|
|
96
|
+
get onDidEvaluateLazyExpression() {
|
|
97
|
+
return this._onDidEvaluateLazyExpression.event;
|
|
98
|
+
}
|
|
99
|
+
updateViews() {
|
|
100
|
+
this._onWillUpdateViews.fire();
|
|
101
|
+
}
|
|
102
|
+
get onWillUpdateViews() {
|
|
103
|
+
return this._onWillUpdateViews.event;
|
|
104
|
+
}
|
|
105
|
+
isMultiSessionView() {
|
|
106
|
+
return !!this.multiSessionDebug.get();
|
|
107
|
+
}
|
|
108
|
+
setMultiSessionView(isMultiSessionView) {
|
|
109
|
+
this.multiSessionDebug.set(isMultiSessionView);
|
|
110
|
+
}
|
|
111
|
+
async evaluateLazyExpression(expression) {
|
|
112
|
+
await expression.evaluateLazy();
|
|
113
|
+
this._onDidEvaluateLazyExpression.fire(expression);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export { ViewModel };
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
4
|
+
import { debuggerDisabledMessage, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
5
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
6
|
+
import { IConfigurationResolverService } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolver';
|
|
7
|
+
import { applyDeprecatedVariableMessage } from '../../../services/configurationResolver/common/configurationResolverUtils.js';
|
|
8
|
+
import { ITextResourcePropertiesService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
9
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
10
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
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 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
15
|
+
import { filter } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
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
|
+
}
|
|
31
|
+
merge(otherDebuggerContribution, extensionDescription) {
|
|
32
|
+
function mixin(destination, source, overwrite, level = 0) {
|
|
33
|
+
if (!isObject(destination)) {
|
|
34
|
+
return source;
|
|
35
|
+
}
|
|
36
|
+
if (isObject(source)) {
|
|
37
|
+
( Object.keys(source)).forEach(key => {
|
|
38
|
+
if (key !== '__proto__') {
|
|
39
|
+
if (isObject(destination[key]) && isObject(source[key])) {
|
|
40
|
+
mixin(destination[key], source[key], overwrite, level + 1);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
if (key in destination) {
|
|
44
|
+
if (overwrite) {
|
|
45
|
+
if (level === 0 && key === 'type') ;
|
|
46
|
+
else {
|
|
47
|
+
destination[key] = source[key];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
destination[key] = source[key];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return destination;
|
|
59
|
+
}
|
|
60
|
+
if (this.mergedExtensionDescriptions.indexOf(extensionDescription) < 0) {
|
|
61
|
+
this.mergedExtensionDescriptions.push(extensionDescription);
|
|
62
|
+
mixin(this.debuggerContribution, otherDebuggerContribution, extensionDescription.isBuiltin);
|
|
63
|
+
if (isDebuggerMainContribution(otherDebuggerContribution)) {
|
|
64
|
+
this.mainExtensionDescription = extensionDescription;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async startDebugging(configuration, parentSessionId) {
|
|
69
|
+
const parentSession = this.debugService.getModel().getSession(parentSessionId);
|
|
70
|
+
return await this.debugService.startDebugging(undefined, configuration, { parentSession }, undefined);
|
|
71
|
+
}
|
|
72
|
+
async createDebugAdapter(session) {
|
|
73
|
+
await this.adapterManager.activateDebuggers('onDebugAdapterProtocolTracker', this.type);
|
|
74
|
+
const da = this.adapterManager.createDebugAdapter(session);
|
|
75
|
+
if (da) {
|
|
76
|
+
return Promise.resolve(da);
|
|
77
|
+
}
|
|
78
|
+
throw new Error(nls.localize('cannot.find.da', "Cannot find debug adapter for type '{0}'.", this.type));
|
|
79
|
+
}
|
|
80
|
+
async substituteVariables(folder, config) {
|
|
81
|
+
const substitutedConfig = await this.adapterManager.substituteVariables(this.type, folder, config);
|
|
82
|
+
return await this.configurationResolverService.resolveWithInteractionReplace(folder, substitutedConfig, 'launch', this.variables, substitutedConfig.__configurationTarget);
|
|
83
|
+
}
|
|
84
|
+
runInTerminal(args, sessionId) {
|
|
85
|
+
return this.adapterManager.runInTerminal(this.type, args, sessionId);
|
|
86
|
+
}
|
|
87
|
+
get label() {
|
|
88
|
+
return this.debuggerContribution.label || this.debuggerContribution.type;
|
|
89
|
+
}
|
|
90
|
+
get type() {
|
|
91
|
+
return this.debuggerContribution.type;
|
|
92
|
+
}
|
|
93
|
+
get variables() {
|
|
94
|
+
return this.debuggerContribution.variables;
|
|
95
|
+
}
|
|
96
|
+
get configurationSnippets() {
|
|
97
|
+
return this.debuggerContribution.configurationSnippets;
|
|
98
|
+
}
|
|
99
|
+
get languages() {
|
|
100
|
+
return this.debuggerContribution.languages;
|
|
101
|
+
}
|
|
102
|
+
get when() {
|
|
103
|
+
return this.debuggerWhen;
|
|
104
|
+
}
|
|
105
|
+
get enabled() {
|
|
106
|
+
return !this.debuggerWhen || this.contextKeyService.contextMatchesRules(this.debuggerWhen);
|
|
107
|
+
}
|
|
108
|
+
get strings() {
|
|
109
|
+
return this.debuggerContribution.strings ?? this.debuggerContribution.uiMessages;
|
|
110
|
+
}
|
|
111
|
+
interestedInLanguage(languageId) {
|
|
112
|
+
return !!(this.languages && this.languages.indexOf(languageId) >= 0);
|
|
113
|
+
}
|
|
114
|
+
hasInitialConfiguration() {
|
|
115
|
+
return !!this.debuggerContribution.initialConfigurations;
|
|
116
|
+
}
|
|
117
|
+
hasConfigurationProvider() {
|
|
118
|
+
return this.debugService.getConfigurationManager().hasDebugConfigurationProvider(this.type);
|
|
119
|
+
}
|
|
120
|
+
getInitialConfigurationContent(initialConfigs) {
|
|
121
|
+
let initialConfigurations = this.debuggerContribution.initialConfigurations || [];
|
|
122
|
+
if (initialConfigs) {
|
|
123
|
+
initialConfigurations = initialConfigurations.concat(initialConfigs);
|
|
124
|
+
}
|
|
125
|
+
const eol = this.resourcePropertiesService.getEOL(( URI.from({ scheme: Schemas.untitled, path: '1' }))) === '\r\n' ? '\r\n' : '\n';
|
|
126
|
+
const configs = ( JSON.stringify(initialConfigurations, null, '\t').split('\n').map(line => '\t' + line)).join(eol).trim();
|
|
127
|
+
const comment1 = ( nls.localize(
|
|
128
|
+
'launch.config.comment1',
|
|
129
|
+
"Use IntelliSense to learn about possible attributes."
|
|
130
|
+
));
|
|
131
|
+
const comment2 = ( nls.localize(
|
|
132
|
+
'launch.config.comment2',
|
|
133
|
+
"Hover to view descriptions of existing attributes."
|
|
134
|
+
));
|
|
135
|
+
const comment3 = ( nls.localize(
|
|
136
|
+
'launch.config.comment3',
|
|
137
|
+
"For more information, visit: {0}",
|
|
138
|
+
'https://go.microsoft.com/fwlink/?linkid=830387'
|
|
139
|
+
));
|
|
140
|
+
let content = [
|
|
141
|
+
'{',
|
|
142
|
+
`\t// ${comment1}`,
|
|
143
|
+
`\t// ${comment2}`,
|
|
144
|
+
`\t// ${comment3}`,
|
|
145
|
+
`\t"version": "0.2.0",`,
|
|
146
|
+
`\t"configurations": ${configs}`,
|
|
147
|
+
'}'
|
|
148
|
+
].join(eol);
|
|
149
|
+
const editorConfig = this.configurationService.getValue();
|
|
150
|
+
if (editorConfig.editor && editorConfig.editor.insertSpaces) {
|
|
151
|
+
content = content.replace(( new RegExp('\t', 'g')), ' '.repeat(editorConfig.editor.tabSize));
|
|
152
|
+
}
|
|
153
|
+
return Promise.resolve(content);
|
|
154
|
+
}
|
|
155
|
+
getMainExtensionDescriptor() {
|
|
156
|
+
return this.mainExtensionDescription || this.mergedExtensionDescriptions[0];
|
|
157
|
+
}
|
|
158
|
+
getCustomTelemetryEndpoint() {
|
|
159
|
+
const aiKey = this.debuggerContribution.aiKey;
|
|
160
|
+
if (!aiKey) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
const sendErrorTelemtry = cleanRemoteAuthority(this.environmentService.remoteAuthority) !== 'other';
|
|
164
|
+
return {
|
|
165
|
+
id: `${this.getMainExtensionDescriptor().publisher}.${this.type}`,
|
|
166
|
+
aiKey,
|
|
167
|
+
sendErrorTelemetry: sendErrorTelemtry
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
getSchemaAttributes(definitions) {
|
|
171
|
+
if (!this.debuggerContribution.configurationAttributes) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
return ( ( Object.keys(this.debuggerContribution.configurationAttributes)).map(request => {
|
|
175
|
+
const definitionId = `${this.type}:${request}`;
|
|
176
|
+
const platformSpecificDefinitionId = `${this.type}:${request}:platform`;
|
|
177
|
+
const attributes = this.debuggerContribution.configurationAttributes[request];
|
|
178
|
+
const defaultRequired = ['name', 'type', 'request'];
|
|
179
|
+
attributes.required = attributes.required && attributes.required.length ? defaultRequired.concat(attributes.required) : defaultRequired;
|
|
180
|
+
attributes.additionalProperties = false;
|
|
181
|
+
attributes.type = 'object';
|
|
182
|
+
if (!attributes.properties) {
|
|
183
|
+
attributes.properties = {};
|
|
184
|
+
}
|
|
185
|
+
const properties = attributes.properties;
|
|
186
|
+
properties['type'] = {
|
|
187
|
+
enum: [this.type],
|
|
188
|
+
enumDescriptions: [this.label],
|
|
189
|
+
description: ( nls.localize('debugType', "Type of configuration.")),
|
|
190
|
+
pattern: '^(?!node2)',
|
|
191
|
+
deprecationMessage: this.debuggerContribution.deprecated || (this.enabled ? undefined : debuggerDisabledMessage(this.type)),
|
|
192
|
+
doNotSuggest: !!this.debuggerContribution.deprecated,
|
|
193
|
+
errorMessage: ( nls.localize(
|
|
194
|
+
'debugTypeNotRecognised',
|
|
195
|
+
"The debug type is not recognized. Make sure that you have a corresponding debug extension installed and that it is enabled."
|
|
196
|
+
)),
|
|
197
|
+
patternErrorMessage: ( nls.localize(
|
|
198
|
+
'node2NotSupported',
|
|
199
|
+
"\"node2\" is no longer supported, use \"node\" instead and set the \"protocol\" attribute to \"inspector\"."
|
|
200
|
+
))
|
|
201
|
+
};
|
|
202
|
+
properties['request'] = {
|
|
203
|
+
enum: [request],
|
|
204
|
+
description: ( nls.localize(
|
|
205
|
+
'debugRequest',
|
|
206
|
+
"Request type of configuration. Can be \"launch\" or \"attach\"."
|
|
207
|
+
)),
|
|
208
|
+
};
|
|
209
|
+
for (const prop in definitions['common'].properties) {
|
|
210
|
+
properties[prop] = {
|
|
211
|
+
$ref: `#/definitions/common/properties/${prop}`
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
( Object.keys(properties)).forEach(name => {
|
|
215
|
+
applyDeprecatedVariableMessage(properties[name]);
|
|
216
|
+
});
|
|
217
|
+
definitions[definitionId] = { ...attributes };
|
|
218
|
+
definitions[platformSpecificDefinitionId] = {
|
|
219
|
+
type: 'object',
|
|
220
|
+
additionalProperties: false,
|
|
221
|
+
properties: filter(properties, key => key !== 'type' && key !== 'request' && key !== 'name')
|
|
222
|
+
};
|
|
223
|
+
const attributesCopy = { ...attributes };
|
|
224
|
+
attributesCopy.properties = {
|
|
225
|
+
...properties,
|
|
226
|
+
...{
|
|
227
|
+
windows: {
|
|
228
|
+
$ref: `#/definitions/${platformSpecificDefinitionId}`,
|
|
229
|
+
description: ( nls.localize(
|
|
230
|
+
'debugWindowsConfiguration',
|
|
231
|
+
"Windows specific launch configuration attributes."
|
|
232
|
+
)),
|
|
233
|
+
},
|
|
234
|
+
osx: {
|
|
235
|
+
$ref: `#/definitions/${platformSpecificDefinitionId}`,
|
|
236
|
+
description: ( nls.localize('debugOSXConfiguration', "OS X specific launch configuration attributes.")),
|
|
237
|
+
},
|
|
238
|
+
linux: {
|
|
239
|
+
$ref: `#/definitions/${platformSpecificDefinitionId}`,
|
|
240
|
+
description: ( nls.localize(
|
|
241
|
+
'debugLinuxConfiguration',
|
|
242
|
+
"Linux specific launch configuration attributes."
|
|
243
|
+
)),
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
return attributesCopy;
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
Debugger = ( __decorate([
|
|
252
|
+
( __param(3, IConfigurationService)),
|
|
253
|
+
( __param(4, ITextResourcePropertiesService)),
|
|
254
|
+
( __param(5, IConfigurationResolverService)),
|
|
255
|
+
( __param(6, IWorkbenchEnvironmentService)),
|
|
256
|
+
( __param(7, IDebugService)),
|
|
257
|
+
( __param(8, IContextKeyService))
|
|
258
|
+
], Debugger));
|
|
259
|
+
|
|
260
|
+
export { Debugger };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
2
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
|
|
4
|
+
class DisassemblyViewInput extends EditorInput {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.resource = undefined;
|
|
8
|
+
}
|
|
9
|
+
static { this.ID = 'debug.disassemblyView.input'; }
|
|
10
|
+
get typeId() {
|
|
11
|
+
return DisassemblyViewInput.ID;
|
|
12
|
+
}
|
|
13
|
+
static get instance() {
|
|
14
|
+
if (!DisassemblyViewInput._instance || DisassemblyViewInput._instance.isDisposed()) {
|
|
15
|
+
DisassemblyViewInput._instance = ( new DisassemblyViewInput());
|
|
16
|
+
}
|
|
17
|
+
return DisassemblyViewInput._instance;
|
|
18
|
+
}
|
|
19
|
+
getName() {
|
|
20
|
+
return ( localize('disassemblyInputName', "Disassembly"));
|
|
21
|
+
}
|
|
22
|
+
matches(other) {
|
|
23
|
+
return other instanceof DisassemblyViewInput;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { DisassemblyViewInput };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
+
import { matchesFuzzy } from 'monaco-editor/esm/vs/base/common/filters.js';
|
|
3
|
+
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
4
|
+
import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
5
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
6
|
+
import { getIconClasses } from 'monaco-editor/esm/vs/editor/common/services/getIconClasses.js';
|
|
7
|
+
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
8
|
+
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
9
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
10
|
+
import { dirname } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
11
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
12
|
+
|
|
13
|
+
async function showLoadedScriptMenu(accessor) {
|
|
14
|
+
const quickInputService = accessor.get(IQuickInputService);
|
|
15
|
+
const debugService = accessor.get(IDebugService);
|
|
16
|
+
const editorService = accessor.get(IEditorService);
|
|
17
|
+
const sessions = debugService.getModel().getSessions(false);
|
|
18
|
+
const modelService = accessor.get(IModelService);
|
|
19
|
+
const languageService = accessor.get(ILanguageService);
|
|
20
|
+
const labelService = accessor.get(ILabelService);
|
|
21
|
+
const localDisposableStore = ( new DisposableStore());
|
|
22
|
+
const quickPick = quickInputService.createQuickPick();
|
|
23
|
+
localDisposableStore.add(quickPick);
|
|
24
|
+
quickPick.matchOnLabel = quickPick.matchOnDescription = quickPick.matchOnDetail = quickPick.sortByLabel = false;
|
|
25
|
+
quickPick.placeholder = ( nls.localize('moveFocusedView.selectView', "Search loaded scripts by name"));
|
|
26
|
+
quickPick.items = await _getPicks(quickPick.value, sessions, editorService, modelService, languageService, labelService);
|
|
27
|
+
localDisposableStore.add(quickPick.onDidChangeValue(async () => {
|
|
28
|
+
quickPick.items = await _getPicks(quickPick.value, sessions, editorService, modelService, languageService, labelService);
|
|
29
|
+
}));
|
|
30
|
+
localDisposableStore.add(quickPick.onDidAccept(() => {
|
|
31
|
+
const selectedItem = quickPick.selectedItems[0];
|
|
32
|
+
selectedItem.accept();
|
|
33
|
+
quickPick.hide();
|
|
34
|
+
localDisposableStore.dispose();
|
|
35
|
+
}));
|
|
36
|
+
quickPick.show();
|
|
37
|
+
}
|
|
38
|
+
async function _getPicksFromSession(session, filter, editorService, modelService, languageService, labelService) {
|
|
39
|
+
const items = [];
|
|
40
|
+
items.push({ type: 'separator', label: session.name });
|
|
41
|
+
const sources = await session.getLoadedSources();
|
|
42
|
+
sources.forEach((element) => {
|
|
43
|
+
const pick = _createPick(element, filter, editorService, modelService, languageService, labelService);
|
|
44
|
+
if (pick) {
|
|
45
|
+
items.push(pick);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return items;
|
|
49
|
+
}
|
|
50
|
+
async function _getPicks(filter, sessions, editorService, modelService, languageService, labelService) {
|
|
51
|
+
const loadedScriptPicks = [];
|
|
52
|
+
const picks = await Promise.all(( sessions.map(
|
|
53
|
+
(session) => _getPicksFromSession(session, filter, editorService, modelService, languageService, labelService)
|
|
54
|
+
)));
|
|
55
|
+
for (const row of picks) {
|
|
56
|
+
for (const elem of row) {
|
|
57
|
+
loadedScriptPicks.push(elem);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return loadedScriptPicks;
|
|
61
|
+
}
|
|
62
|
+
function _createPick(source, filter, editorService, modelService, languageService, labelService) {
|
|
63
|
+
const label = labelService.getUriBasenameLabel(source.uri);
|
|
64
|
+
const desc = labelService.getUriLabel(dirname(source.uri));
|
|
65
|
+
const labelHighlights = matchesFuzzy(filter, label, true);
|
|
66
|
+
const descHighlights = matchesFuzzy(filter, desc, true);
|
|
67
|
+
if (labelHighlights || descHighlights) {
|
|
68
|
+
return {
|
|
69
|
+
label,
|
|
70
|
+
description: desc === '.' ? undefined : desc,
|
|
71
|
+
highlights: { label: labelHighlights ?? undefined, description: descHighlights ?? undefined },
|
|
72
|
+
iconClasses: getIconClasses(modelService, languageService, source.uri),
|
|
73
|
+
accept: () => {
|
|
74
|
+
if (source.available) {
|
|
75
|
+
source.openInEditor(editorService, { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { showLoadedScriptMenu };
|