@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
|
@@ -0,0 +1,106 @@
|
|
|
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 { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { IDebugService, REPL_VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
5
|
+
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
6
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/common/views';
|
|
7
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
8
|
+
|
|
9
|
+
async function showDebugSessionMenu(accessor, selectAndStartID) {
|
|
10
|
+
const quickInputService = accessor.get(IQuickInputService);
|
|
11
|
+
const debugService = accessor.get(IDebugService);
|
|
12
|
+
const viewsService = accessor.get(IViewsService);
|
|
13
|
+
const commandService = accessor.get(ICommandService);
|
|
14
|
+
const localDisposableStore = ( new DisposableStore());
|
|
15
|
+
const quickPick = quickInputService.createQuickPick();
|
|
16
|
+
localDisposableStore.add(quickPick);
|
|
17
|
+
quickPick.matchOnLabel = quickPick.matchOnDescription = quickPick.matchOnDetail = quickPick.sortByLabel = false;
|
|
18
|
+
quickPick.placeholder = ( nls.localize('moveFocusedView.selectView', 'Search debug sessions by name'));
|
|
19
|
+
const pickItems = _getPicksAndActiveItem(quickPick.value, selectAndStartID, debugService, viewsService, commandService);
|
|
20
|
+
quickPick.items = pickItems.picks;
|
|
21
|
+
quickPick.activeItems = pickItems.activeItems;
|
|
22
|
+
localDisposableStore.add(quickPick.onDidChangeValue(async () => {
|
|
23
|
+
quickPick.items = _getPicksAndActiveItem(quickPick.value, selectAndStartID, debugService, viewsService, commandService).picks;
|
|
24
|
+
}));
|
|
25
|
+
localDisposableStore.add(quickPick.onDidAccept(() => {
|
|
26
|
+
const selectedItem = quickPick.selectedItems[0];
|
|
27
|
+
selectedItem.accept();
|
|
28
|
+
quickPick.hide();
|
|
29
|
+
localDisposableStore.dispose();
|
|
30
|
+
}));
|
|
31
|
+
quickPick.show();
|
|
32
|
+
}
|
|
33
|
+
function _getPicksAndActiveItem(filter, selectAndStartID, debugService, viewsService, commandService) {
|
|
34
|
+
const debugConsolePicks = [];
|
|
35
|
+
const headerSessions = [];
|
|
36
|
+
const currSession = debugService.getViewModel().focusedSession;
|
|
37
|
+
const sessions = debugService.getModel().getSessions(false);
|
|
38
|
+
const activeItems = [];
|
|
39
|
+
sessions.forEach((session) => {
|
|
40
|
+
if (session.compact && session.parentSession) {
|
|
41
|
+
headerSessions.push(session.parentSession);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
sessions.forEach((session) => {
|
|
45
|
+
const isHeader = headerSessions.includes(session);
|
|
46
|
+
if (!session.parentSession) {
|
|
47
|
+
debugConsolePicks.push({ type: 'separator', label: isHeader ? session.name : undefined });
|
|
48
|
+
}
|
|
49
|
+
if (!isHeader) {
|
|
50
|
+
const pick = _createPick(session, filter, debugService, viewsService);
|
|
51
|
+
if (pick) {
|
|
52
|
+
debugConsolePicks.push(pick);
|
|
53
|
+
if (session.getId() === currSession?.getId()) {
|
|
54
|
+
activeItems.push(pick);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
if (debugConsolePicks.length) {
|
|
60
|
+
debugConsolePicks.push({ type: 'separator' });
|
|
61
|
+
}
|
|
62
|
+
const createDebugSessionLabel = ( nls.localize('workbench.action.debug.startDebug', 'Start a New Debug Session'));
|
|
63
|
+
debugConsolePicks.push({
|
|
64
|
+
label: `$(plus) ${createDebugSessionLabel}`,
|
|
65
|
+
ariaLabel: createDebugSessionLabel,
|
|
66
|
+
accept: () => commandService.executeCommand(selectAndStartID)
|
|
67
|
+
});
|
|
68
|
+
return { picks: debugConsolePicks, activeItems };
|
|
69
|
+
}
|
|
70
|
+
function _getSessionInfo(session) {
|
|
71
|
+
const label = (!session.configuration.name.length) ? session.name : session.configuration.name;
|
|
72
|
+
const parentName = session.compact ? undefined : session.parentSession?.configuration.name;
|
|
73
|
+
let description = '';
|
|
74
|
+
let ariaLabel = '';
|
|
75
|
+
if (parentName) {
|
|
76
|
+
ariaLabel = ( nls.localize(
|
|
77
|
+
'workbench.action.debug.spawnFrom',
|
|
78
|
+
'Session {0} spawned from {1}',
|
|
79
|
+
label,
|
|
80
|
+
parentName
|
|
81
|
+
));
|
|
82
|
+
description = parentName;
|
|
83
|
+
}
|
|
84
|
+
return { label, description, ariaLabel };
|
|
85
|
+
}
|
|
86
|
+
function _createPick(session, filter, debugService, viewsService, commandService) {
|
|
87
|
+
const pickInfo = _getSessionInfo(session);
|
|
88
|
+
const highlights = matchesFuzzy(filter, pickInfo.label, true);
|
|
89
|
+
if (highlights) {
|
|
90
|
+
return {
|
|
91
|
+
label: pickInfo.label,
|
|
92
|
+
description: pickInfo.description,
|
|
93
|
+
ariaLabel: pickInfo.ariaLabel,
|
|
94
|
+
highlights: { label: highlights },
|
|
95
|
+
accept: () => {
|
|
96
|
+
debugService.focusStackFrame(undefined, undefined, session, { explicit: true });
|
|
97
|
+
if (!viewsService.isViewVisible(REPL_VIEW_ID)) {
|
|
98
|
+
viewsService.openView(REPL_VIEW_ID, true);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { showDebugSessionMenu };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { 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 { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
7
|
+
|
|
8
|
+
let DebugStatusContribution = class DebugStatusContribution {
|
|
9
|
+
constructor(statusBarService, debugService, configurationService) {
|
|
10
|
+
this.statusBarService = statusBarService;
|
|
11
|
+
this.debugService = debugService;
|
|
12
|
+
this.toDispose = [];
|
|
13
|
+
const addStatusBarEntry = () => {
|
|
14
|
+
this.entryAccessor = this.statusBarService.addEntry(this.entry, 'status.debug', 0 , 30 );
|
|
15
|
+
};
|
|
16
|
+
const setShowInStatusBar = () => {
|
|
17
|
+
this.showInStatusBar = configurationService.getValue('debug').showInStatusBar;
|
|
18
|
+
if (this.showInStatusBar === 'always' && !this.entryAccessor) {
|
|
19
|
+
addStatusBarEntry();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
setShowInStatusBar();
|
|
23
|
+
this.toDispose.push(this.debugService.onDidChangeState(state => {
|
|
24
|
+
if (state !== 0 && this.showInStatusBar === 'onFirstSessionStart' && !this.entryAccessor) {
|
|
25
|
+
addStatusBarEntry();
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
this.toDispose.push(configurationService.onDidChangeConfiguration(e => {
|
|
29
|
+
if (e.affectsConfiguration('debug.showInStatusBar')) {
|
|
30
|
+
setShowInStatusBar();
|
|
31
|
+
if (this.entryAccessor && this.showInStatusBar === 'never') {
|
|
32
|
+
this.entryAccessor.dispose();
|
|
33
|
+
this.entryAccessor = undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
this.toDispose.push(this.debugService.getConfigurationManager().onDidSelectConfiguration(e => {
|
|
38
|
+
this.entryAccessor?.update(this.entry);
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
get entry() {
|
|
42
|
+
let text = '';
|
|
43
|
+
const manager = this.debugService.getConfigurationManager();
|
|
44
|
+
const name = manager.selectedConfiguration.name || '';
|
|
45
|
+
const nameAndLaunchPresent = name && manager.selectedConfiguration.launch;
|
|
46
|
+
if (nameAndLaunchPresent) {
|
|
47
|
+
text = (manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch.name})` : name);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
name: ( nls.localize('status.debug', "Debug")),
|
|
51
|
+
text: '$(debug-alt-small) ' + text,
|
|
52
|
+
ariaLabel: ( nls.localize('debugTarget', "Debug: {0}", text)),
|
|
53
|
+
tooltip: ( nls.localize('selectAndStartDebug', "Select and start debug configuration")),
|
|
54
|
+
command: 'workbench.action.debug.selectandstart'
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
dispose() {
|
|
58
|
+
this.entryAccessor?.dispose();
|
|
59
|
+
dispose(this.toDispose);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
DebugStatusContribution = ( __decorate([
|
|
63
|
+
( __param(0, IStatusbarService)),
|
|
64
|
+
( __param(1, IDebugService)),
|
|
65
|
+
( __param(2, IConfigurationService))
|
|
66
|
+
], DebugStatusContribution));
|
|
67
|
+
|
|
68
|
+
export { DebugStatusContribution };
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
|
|
4
|
+
import { Markers } from 'vscode/vscode/vs/workbench/contrib/markers/common/markers';
|
|
5
|
+
import { ITaskService } from 'vscode/vscode/vs/workbench/contrib/tasks/common/taskService';
|
|
6
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
7
|
+
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
8
|
+
import { MarkerSeverity, IMarkerService } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
|
|
9
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/common/views';
|
|
10
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
11
|
+
import { createErrorWithActions } from 'monaco-editor/esm/vs/base/common/errorMessage.js';
|
|
12
|
+
import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
13
|
+
import { DEBUG_CONFIGURE_COMMAND_ID, DEBUG_CONFIGURE_LABEL } from './debugCommands.js';
|
|
14
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
15
|
+
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
16
|
+
|
|
17
|
+
function once(match, event) {
|
|
18
|
+
return (listener, thisArgs = null, disposables) => {
|
|
19
|
+
const result = event(e => {
|
|
20
|
+
if (match(e)) {
|
|
21
|
+
result.dispose();
|
|
22
|
+
return listener.call(thisArgs, e);
|
|
23
|
+
}
|
|
24
|
+
}, null, disposables);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const DEBUG_TASK_ERROR_CHOICE_KEY = 'debug.taskerrorchoice';
|
|
29
|
+
let DebugTaskRunner = class DebugTaskRunner {
|
|
30
|
+
constructor(taskService, markerService, configurationService, viewsService, dialogService, storageService, commandService) {
|
|
31
|
+
this.taskService = taskService;
|
|
32
|
+
this.markerService = markerService;
|
|
33
|
+
this.configurationService = configurationService;
|
|
34
|
+
this.viewsService = viewsService;
|
|
35
|
+
this.dialogService = dialogService;
|
|
36
|
+
this.storageService = storageService;
|
|
37
|
+
this.commandService = commandService;
|
|
38
|
+
this.canceled = false;
|
|
39
|
+
}
|
|
40
|
+
cancel() {
|
|
41
|
+
this.canceled = true;
|
|
42
|
+
}
|
|
43
|
+
async runTaskAndCheckErrors(root, taskId) {
|
|
44
|
+
try {
|
|
45
|
+
this.canceled = false;
|
|
46
|
+
const taskSummary = await this.runTask(root, taskId);
|
|
47
|
+
if (this.canceled || (taskSummary && taskSummary.exitCode === undefined)) {
|
|
48
|
+
return 0 ;
|
|
49
|
+
}
|
|
50
|
+
const errorCount = taskId ? this.markerService.read({ severities: MarkerSeverity.Error, take: 2 }).length : 0;
|
|
51
|
+
const successExitCode = taskSummary && taskSummary.exitCode === 0;
|
|
52
|
+
const failureExitCode = taskSummary && taskSummary.exitCode !== 0;
|
|
53
|
+
const onTaskErrors = this.configurationService.getValue('debug').onTaskErrors;
|
|
54
|
+
if (successExitCode || onTaskErrors === 'debugAnyway' || (errorCount === 0 && !failureExitCode)) {
|
|
55
|
+
return 1 ;
|
|
56
|
+
}
|
|
57
|
+
if (onTaskErrors === 'showErrors') {
|
|
58
|
+
await this.viewsService.openView(Markers.MARKERS_VIEW_ID, true);
|
|
59
|
+
return Promise.resolve(0 );
|
|
60
|
+
}
|
|
61
|
+
if (onTaskErrors === 'abort') {
|
|
62
|
+
return Promise.resolve(0 );
|
|
63
|
+
}
|
|
64
|
+
const taskLabel = typeof taskId === 'string' ? taskId : taskId ? taskId.name : '';
|
|
65
|
+
const message = errorCount > 1
|
|
66
|
+
? ( nls.localize(
|
|
67
|
+
'preLaunchTaskErrors',
|
|
68
|
+
"Errors exist after running preLaunchTask '{0}'.",
|
|
69
|
+
taskLabel
|
|
70
|
+
))
|
|
71
|
+
: errorCount === 1
|
|
72
|
+
? ( nls.localize(
|
|
73
|
+
'preLaunchTaskError',
|
|
74
|
+
"Error exists after running preLaunchTask '{0}'.",
|
|
75
|
+
taskLabel
|
|
76
|
+
))
|
|
77
|
+
: taskSummary && typeof taskSummary.exitCode === 'number'
|
|
78
|
+
? ( nls.localize(
|
|
79
|
+
'preLaunchTaskExitCode',
|
|
80
|
+
"The preLaunchTask '{0}' terminated with exit code {1}.",
|
|
81
|
+
taskLabel,
|
|
82
|
+
taskSummary.exitCode
|
|
83
|
+
))
|
|
84
|
+
: ( nls.localize(
|
|
85
|
+
'preLaunchTaskTerminated',
|
|
86
|
+
"The preLaunchTask '{0}' terminated.",
|
|
87
|
+
taskLabel
|
|
88
|
+
));
|
|
89
|
+
let DebugChoice;
|
|
90
|
+
( (function(DebugChoice) {
|
|
91
|
+
DebugChoice[DebugChoice["DebugAnyway"] = 1] = "DebugAnyway";
|
|
92
|
+
DebugChoice[DebugChoice["ShowErrors"] = 2] = "ShowErrors";
|
|
93
|
+
DebugChoice[DebugChoice["Cancel"] = 0] = "Cancel";
|
|
94
|
+
})(DebugChoice || (DebugChoice = {})));
|
|
95
|
+
const { result, checkboxChecked } = await this.dialogService.prompt({
|
|
96
|
+
type: Severity.Warning,
|
|
97
|
+
message,
|
|
98
|
+
buttons: [
|
|
99
|
+
{
|
|
100
|
+
label: ( nls.localize(
|
|
101
|
+
{ key: 'debugAnyway', comment: ['&& denotes a mnemonic'] },
|
|
102
|
+
"&&Debug Anyway"
|
|
103
|
+
)),
|
|
104
|
+
run: () => DebugChoice.DebugAnyway
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
label: ( nls.localize({ key: 'showErrors', comment: ['&& denotes a mnemonic'] }, "&&Show Errors")),
|
|
108
|
+
run: () => DebugChoice.ShowErrors
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
cancelButton: {
|
|
112
|
+
label: ( nls.localize('abort', "Abort")),
|
|
113
|
+
run: () => DebugChoice.Cancel
|
|
114
|
+
},
|
|
115
|
+
checkbox: {
|
|
116
|
+
label: ( nls.localize('remember', "Remember my choice in user settings")),
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const debugAnyway = result === DebugChoice.DebugAnyway;
|
|
120
|
+
const abort = result === DebugChoice.Cancel;
|
|
121
|
+
if (checkboxChecked) {
|
|
122
|
+
this.configurationService.updateValue('debug.onTaskErrors', result === DebugChoice.DebugAnyway ? 'debugAnyway' : abort ? 'abort' : 'showErrors');
|
|
123
|
+
}
|
|
124
|
+
if (abort) {
|
|
125
|
+
return Promise.resolve(0 );
|
|
126
|
+
}
|
|
127
|
+
if (debugAnyway) {
|
|
128
|
+
return 1 ;
|
|
129
|
+
}
|
|
130
|
+
await this.viewsService.openView(Markers.MARKERS_VIEW_ID, true);
|
|
131
|
+
return Promise.resolve(0 );
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
const taskConfigureAction = this.taskService.configureAction();
|
|
135
|
+
const choiceMap = JSON.parse(this.storageService.get(DEBUG_TASK_ERROR_CHOICE_KEY, 1 , '{}'));
|
|
136
|
+
let choice = -1;
|
|
137
|
+
let DebugChoice;
|
|
138
|
+
( (function(DebugChoice) {
|
|
139
|
+
DebugChoice[DebugChoice["DebugAnyway"] = 0] = "DebugAnyway";
|
|
140
|
+
DebugChoice[DebugChoice["ConfigureTask"] = 1] = "ConfigureTask";
|
|
141
|
+
DebugChoice[DebugChoice["Cancel"] = 2] = "Cancel";
|
|
142
|
+
})(DebugChoice || (DebugChoice = {})));
|
|
143
|
+
if (choiceMap[err.message] !== undefined) {
|
|
144
|
+
choice = choiceMap[err.message];
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
const { result, checkboxChecked } = await this.dialogService.prompt({
|
|
148
|
+
type: Severity.Error,
|
|
149
|
+
message: err.message,
|
|
150
|
+
buttons: [
|
|
151
|
+
{
|
|
152
|
+
label: ( nls.localize(
|
|
153
|
+
{ key: 'debugAnyway', comment: ['&& denotes a mnemonic'] },
|
|
154
|
+
"&&Debug Anyway"
|
|
155
|
+
)),
|
|
156
|
+
run: () => DebugChoice.DebugAnyway
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: taskConfigureAction.label,
|
|
160
|
+
run: () => DebugChoice.ConfigureTask
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
cancelButton: {
|
|
164
|
+
run: () => DebugChoice.Cancel
|
|
165
|
+
},
|
|
166
|
+
checkbox: {
|
|
167
|
+
label: ( nls.localize('rememberTask', "Remember my choice for this task"))
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
choice = result;
|
|
171
|
+
if (checkboxChecked) {
|
|
172
|
+
choiceMap[err.message] = choice;
|
|
173
|
+
this.storageService.store(DEBUG_TASK_ERROR_CHOICE_KEY, JSON.stringify(choiceMap), 1 , 1 );
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (choice === DebugChoice.ConfigureTask) {
|
|
177
|
+
await taskConfigureAction.run();
|
|
178
|
+
}
|
|
179
|
+
return choice === DebugChoice.DebugAnyway ? 1 : 0 ;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
async runTask(root, taskId) {
|
|
183
|
+
if (!taskId) {
|
|
184
|
+
return Promise.resolve(null);
|
|
185
|
+
}
|
|
186
|
+
if (!root) {
|
|
187
|
+
return Promise.reject(( new Error(( nls.localize(
|
|
188
|
+
'invalidTaskReference',
|
|
189
|
+
"Task '{0}' can not be referenced from a launch configuration that is in a different workspace folder.",
|
|
190
|
+
typeof taskId === 'string' ? taskId : taskId.type
|
|
191
|
+
)))));
|
|
192
|
+
}
|
|
193
|
+
const task = await this.taskService.getTask(root, taskId);
|
|
194
|
+
if (!task) {
|
|
195
|
+
const errorMessage = typeof taskId === 'string'
|
|
196
|
+
? ( nls.localize('DebugTaskNotFoundWithTaskId', "Could not find the task '{0}'.", taskId))
|
|
197
|
+
: ( nls.localize('DebugTaskNotFound', "Could not find the specified task."));
|
|
198
|
+
return Promise.reject(createErrorWithActions(errorMessage, [( new Action(
|
|
199
|
+
DEBUG_CONFIGURE_COMMAND_ID,
|
|
200
|
+
DEBUG_CONFIGURE_LABEL,
|
|
201
|
+
undefined,
|
|
202
|
+
true,
|
|
203
|
+
() => this.commandService.executeCommand(DEBUG_CONFIGURE_COMMAND_ID)
|
|
204
|
+
))]));
|
|
205
|
+
}
|
|
206
|
+
let taskStarted = false;
|
|
207
|
+
const inactivePromise = ( new Promise((c, e) => once(e => {
|
|
208
|
+
return (e.kind === "inactive"
|
|
209
|
+
|| (e.kind === "processEnded" && e.exitCode === undefined))
|
|
210
|
+
&& e.taskId === task._id;
|
|
211
|
+
}, this.taskService.onDidStateChange)(e => {
|
|
212
|
+
taskStarted = true;
|
|
213
|
+
c(e.kind === "processEnded" ? { exitCode: e.exitCode } : null);
|
|
214
|
+
})));
|
|
215
|
+
const promise = this.taskService.getActiveTasks().then(async (tasks) => {
|
|
216
|
+
if (tasks.find(t => t._id === task._id)) {
|
|
217
|
+
const busyTasks = await this.taskService.getBusyTasks();
|
|
218
|
+
if (busyTasks.find(t => t._id === task._id)) {
|
|
219
|
+
taskStarted = true;
|
|
220
|
+
return inactivePromise;
|
|
221
|
+
}
|
|
222
|
+
return Promise.resolve(null);
|
|
223
|
+
}
|
|
224
|
+
once(e => (((e.kind === "active") ) || ((e.kind === "dependsOnStarted") )) && e.taskId === task._id, this.taskService.onDidStateChange)(() => {
|
|
225
|
+
taskStarted = true;
|
|
226
|
+
});
|
|
227
|
+
const taskPromise = this.taskService.run(task);
|
|
228
|
+
if (task.configurationProperties.isBackground) {
|
|
229
|
+
return inactivePromise;
|
|
230
|
+
}
|
|
231
|
+
return taskPromise.then(x => x ?? null);
|
|
232
|
+
});
|
|
233
|
+
return ( new Promise((c, e) => {
|
|
234
|
+
const waitForInput = ( new Promise(
|
|
235
|
+
resolve => once(e => ((e.kind === "acquiredInput") ) && e.taskId === task._id, this.taskService.onDidStateChange)(() => {
|
|
236
|
+
resolve();
|
|
237
|
+
})
|
|
238
|
+
));
|
|
239
|
+
promise.then(result => {
|
|
240
|
+
taskStarted = true;
|
|
241
|
+
c(result);
|
|
242
|
+
}, error => e(error));
|
|
243
|
+
waitForInput.then(() => {
|
|
244
|
+
const waitTime = task.configurationProperties.isBackground ? 5000 : 10000;
|
|
245
|
+
setTimeout(() => {
|
|
246
|
+
if (!taskStarted) {
|
|
247
|
+
const errorMessage = typeof taskId === 'string'
|
|
248
|
+
? ( nls.localize(
|
|
249
|
+
'taskNotTrackedWithTaskId',
|
|
250
|
+
"The task '{0}' cannot be tracked. Make sure to have a problem matcher defined.",
|
|
251
|
+
taskId
|
|
252
|
+
))
|
|
253
|
+
: ( nls.localize(
|
|
254
|
+
'taskNotTracked',
|
|
255
|
+
"The task '{0}' cannot be tracked. Make sure to have a problem matcher defined.",
|
|
256
|
+
JSON.stringify(taskId)
|
|
257
|
+
));
|
|
258
|
+
e({ severity: Severity.Error, message: errorMessage });
|
|
259
|
+
}
|
|
260
|
+
}, waitTime);
|
|
261
|
+
});
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
DebugTaskRunner = ( __decorate([
|
|
266
|
+
( __param(0, ITaskService)),
|
|
267
|
+
( __param(1, IMarkerService)),
|
|
268
|
+
( __param(2, IConfigurationService)),
|
|
269
|
+
( __param(3, IViewsService)),
|
|
270
|
+
( __param(4, IDialogService)),
|
|
271
|
+
( __param(5, IStorageService)),
|
|
272
|
+
( __param(6, ICommandService))
|
|
273
|
+
], DebugTaskRunner));
|
|
274
|
+
|
|
275
|
+
export { DebugTaskRunner };
|