@codingame/monaco-vscode-debug-service-override 5.2.0 → 6.0.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +26 -23
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +8 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +2 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +23 -20
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +38 -19
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +22 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +10 -10
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +2 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +4 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +76 -57
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +13 -11
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +4 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +23 -16
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +2 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +15 -13
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +8 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +3 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +5 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +3 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +5 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +29 -26
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +3 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +7 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +7 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +12 -11
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +3 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +21 -20
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +5 -3
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +1 -0
|
@@ -19,21 +19,25 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
|
|
|
19
19
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
20
20
|
import { IExtensionHostDebugService } from 'vscode/vscode/vs/platform/debug/common/extensionHostDebug.service';
|
|
21
21
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
22
|
+
import { FileChangeType } from 'vscode/vscode/vs/platform/files/common/files';
|
|
22
23
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
23
24
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
24
25
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
25
26
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
26
27
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
28
|
+
import { WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
27
29
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
28
30
|
import { IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
31
|
+
import { EditorsOrder } from 'vscode/vscode/vs/workbench/common/editor';
|
|
32
|
+
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
29
33
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
30
34
|
import { AdapterManager } from './debugAdapterManager.js';
|
|
31
35
|
import { DEBUG_CONFIGURE_COMMAND_ID, DEBUG_CONFIGURE_LABEL } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugCommands';
|
|
32
36
|
import { ConfigurationManager } from './debugConfigurationManager.js';
|
|
33
37
|
import { DebugMemoryFileSystemProvider } from './debugMemory.js';
|
|
34
38
|
import { DebugSession } from './debugSession.js';
|
|
35
|
-
import { DebugTaskRunner } from './debugTaskRunner.js';
|
|
36
|
-
import { CALLSTACK_VIEW_ID, DEBUG_MEMORY_SCHEME, CONTEXT_DEBUG_TYPE, CONTEXT_DEBUG_STATE, CONTEXT_HAS_DEBUGGED, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_UX, CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DISASSEMBLY_VIEW_FOCUS, getStateLabel, debuggerDisabledMessage, VIEWLET_ID, REPL_VIEW_ID, DEBUG_SCHEME } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
39
|
+
import { DebugTaskRunner, TaskRunResult } from './debugTaskRunner.js';
|
|
40
|
+
import { State, CALLSTACK_VIEW_ID, DEBUG_MEMORY_SCHEME, CONTEXT_DEBUG_TYPE, CONTEXT_DEBUG_STATE, CONTEXT_HAS_DEBUGGED, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_UX, CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DISASSEMBLY_VIEW_FOCUS, getStateLabel, debuggerDisabledMessage, VIEWLET_ID, REPL_VIEW_ID, DEBUG_SCHEME } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
37
41
|
import { DebugCompoundRoot } from '../common/debugCompoundRoot.js';
|
|
38
42
|
import { DebugModel, Breakpoint, FunctionBreakpoint, DataBreakpoint, InstructionBreakpoint } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
39
43
|
import { Source } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugSource';
|
|
@@ -47,6 +51,7 @@ import { NumberBadge } from 'vscode/vscode/vs/workbench/services/activity/common
|
|
|
47
51
|
import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity.service';
|
|
48
52
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
49
53
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
54
|
+
import { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
50
55
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
51
56
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
52
57
|
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
|
|
@@ -122,7 +127,7 @@ let DebugService = class DebugService {
|
|
|
122
127
|
}
|
|
123
128
|
}));
|
|
124
129
|
this.disposables.add(Event.any(this.adapterManager.onDidRegisterDebugger, this.configurationManager.onDidSelectConfiguration)(() => {
|
|
125
|
-
const debugUxValue = (this.state !==
|
|
130
|
+
const debugUxValue = (this.state !== State.Inactive || (this.configurationManager.getAllConfigurations().length > 0 && this.adapterManager.hasEnabledDebuggers())) ? 'default' : 'simple';
|
|
126
131
|
this.debugUx.set(debugUxValue);
|
|
127
132
|
this.debugStorage.storeDebugUxState(debugUxValue);
|
|
128
133
|
}));
|
|
@@ -153,6 +158,9 @@ let DebugService = class DebugService {
|
|
|
153
158
|
}
|
|
154
159
|
}
|
|
155
160
|
}));
|
|
161
|
+
this.disposables.add(extensionService.onWillStop(evt => {
|
|
162
|
+
evt.veto(this.stopSession(undefined).then(() => false), ( localizeWithPath(_moduleId, 2, 'Stopping debug sessions...')));
|
|
163
|
+
}));
|
|
156
164
|
this.initContextKeys(contextKeyService);
|
|
157
165
|
}
|
|
158
166
|
initContextKeys(contextKeyService) {
|
|
@@ -195,7 +203,7 @@ let DebugService = class DebugService {
|
|
|
195
203
|
if (focusedSession) {
|
|
196
204
|
return focusedSession.state;
|
|
197
205
|
}
|
|
198
|
-
return this.initializing ?
|
|
206
|
+
return this.initializing ? State.Initializing : State.Inactive;
|
|
199
207
|
}
|
|
200
208
|
get initializingOptions() {
|
|
201
209
|
return this._initializingOptions;
|
|
@@ -232,8 +240,8 @@ let DebugService = class DebugService {
|
|
|
232
240
|
if (this.previousState !== state) {
|
|
233
241
|
this.contextKeyService.bufferChangeEvents(() => {
|
|
234
242
|
this.debugState.set(getStateLabel(state));
|
|
235
|
-
this.inDebugMode.set(state !==
|
|
236
|
-
const debugUxValue = ((
|
|
243
|
+
this.inDebugMode.set(state !== State.Inactive);
|
|
244
|
+
const debugUxValue = ((state !== State.Inactive && state !== State.Initializing) || (this.adapterManager.hasEnabledDebuggers() && this.configurationManager.selectedConfiguration.name)) ? 'default' : 'simple';
|
|
237
245
|
this.debugUx.set(debugUxValue);
|
|
238
246
|
this.debugStorage.storeDebugUxState(debugUxValue);
|
|
239
247
|
});
|
|
@@ -262,11 +270,11 @@ let DebugService = class DebugService {
|
|
|
262
270
|
async startDebugging(launch, configOrName, options, saveBeforeStart = !options?.parentSession) {
|
|
263
271
|
const message = options && options.noDebug ? ( localizeWithPath(
|
|
264
272
|
_moduleId,
|
|
265
|
-
|
|
273
|
+
3,
|
|
266
274
|
"Running executes build tasks and program code from your workspace."
|
|
267
275
|
)) : ( localizeWithPath(
|
|
268
276
|
_moduleId,
|
|
269
|
-
|
|
277
|
+
4,
|
|
270
278
|
"Debugging executes build tasks and program code from your workspace."
|
|
271
279
|
));
|
|
272
280
|
const trust = await this.workspaceTrustRequestService.requestWorkspaceTrust({ message });
|
|
@@ -298,13 +306,13 @@ let DebugService = class DebugService {
|
|
|
298
306
|
if (!compound.configurations) {
|
|
299
307
|
throw ( (new Error(localizeWithPath(
|
|
300
308
|
_moduleId,
|
|
301
|
-
|
|
309
|
+
5,
|
|
302
310
|
"Compound must have \"configurations\" attribute set in order to start multiple configurations."
|
|
303
311
|
))));
|
|
304
312
|
}
|
|
305
313
|
if (compound.preLaunchTask) {
|
|
306
314
|
const taskResult = await this.taskRunner.runTaskAndCheckErrors(launch?.workspace || this.contextService.getWorkspace(), compound.preLaunchTask);
|
|
307
|
-
if (taskResult ===
|
|
315
|
+
if (taskResult === TaskRunResult.Failure) {
|
|
308
316
|
this.endInitializingState();
|
|
309
317
|
return false;
|
|
310
318
|
}
|
|
@@ -329,13 +337,13 @@ let DebugService = class DebugService {
|
|
|
329
337
|
else {
|
|
330
338
|
throw ( (new Error(launchesContainingName.length === 0 ? localizeWithPath(
|
|
331
339
|
_moduleId,
|
|
332
|
-
|
|
340
|
+
6,
|
|
333
341
|
"Could not find launch configuration '{0}' in the workspace.",
|
|
334
342
|
name
|
|
335
343
|
)
|
|
336
344
|
: localizeWithPath(
|
|
337
345
|
_moduleId,
|
|
338
|
-
|
|
346
|
+
7,
|
|
339
347
|
"There are multiple launch configurations '{0}' in the workspace. Use folder name to qualify the configuration.",
|
|
340
348
|
name
|
|
341
349
|
))));
|
|
@@ -349,7 +357,7 @@ let DebugService = class DebugService {
|
|
|
349
357
|
else {
|
|
350
358
|
throw ( (new Error(localizeWithPath(
|
|
351
359
|
_moduleId,
|
|
352
|
-
|
|
360
|
+
8,
|
|
353
361
|
"Can not find folder with name '{0}' for configuration '{1}' in compound '{2}'.",
|
|
354
362
|
configData.folder,
|
|
355
363
|
configData.name,
|
|
@@ -366,11 +374,11 @@ let DebugService = class DebugService {
|
|
|
366
374
|
if (configOrName && !config) {
|
|
367
375
|
const message = !!launch ? ( localizeWithPath(
|
|
368
376
|
_moduleId,
|
|
369
|
-
|
|
377
|
+
9,
|
|
370
378
|
"Configuration '{0}' is missing in 'launch.json'.",
|
|
371
379
|
typeof configOrName === 'string' ? configOrName : configOrName.name
|
|
372
380
|
)) :
|
|
373
|
-
( localizeWithPath(_moduleId,
|
|
381
|
+
( localizeWithPath(_moduleId, 10, "'launch.json' does not exist for passed workspace folder."));
|
|
374
382
|
throw ( (new Error(message)));
|
|
375
383
|
}
|
|
376
384
|
const result = await this.createSession(launch, config, options);
|
|
@@ -427,7 +435,7 @@ let DebugService = class DebugService {
|
|
|
427
435
|
}
|
|
428
436
|
const workspace = launch?.workspace || this.contextService.getWorkspace();
|
|
429
437
|
const taskResult = await this.taskRunner.runTaskAndCheckErrors(workspace, resolvedConfig.preLaunchTask);
|
|
430
|
-
if (taskResult ===
|
|
438
|
+
if (taskResult === TaskRunResult.Failure) {
|
|
431
439
|
return false;
|
|
432
440
|
}
|
|
433
441
|
const cfg = await this.configurationManager.resolveDebugConfigurationWithSubstitutedVariables(launch && launch.workspace ? launch.workspace.uri : undefined, resolvedConfig.type, resolvedConfig, initCancellationToken.token);
|
|
@@ -444,14 +452,14 @@ let DebugService = class DebugService {
|
|
|
444
452
|
if (configByProviders.request !== 'attach' && configByProviders.request !== 'launch') {
|
|
445
453
|
message = configByProviders.request ? ( localizeWithPath(
|
|
446
454
|
_moduleId,
|
|
447
|
-
|
|
455
|
+
11,
|
|
448
456
|
"Attribute '{0}' has an unsupported value '{1}' in the chosen debug configuration.",
|
|
449
457
|
'request',
|
|
450
458
|
configByProviders.request
|
|
451
459
|
))
|
|
452
460
|
: ( localizeWithPath(
|
|
453
461
|
_moduleId,
|
|
454
|
-
|
|
462
|
+
12,
|
|
455
463
|
"Attribute '{0}' is missing from the chosen debug configuration.",
|
|
456
464
|
'request'
|
|
457
465
|
));
|
|
@@ -459,18 +467,18 @@ let DebugService = class DebugService {
|
|
|
459
467
|
else {
|
|
460
468
|
message = resolvedConfig.type ? ( localizeWithPath(
|
|
461
469
|
_moduleId,
|
|
462
|
-
|
|
470
|
+
13,
|
|
463
471
|
"Configured debug type '{0}' is not supported.",
|
|
464
472
|
resolvedConfig.type
|
|
465
473
|
)) :
|
|
466
474
|
( localizeWithPath(
|
|
467
475
|
_moduleId,
|
|
468
|
-
|
|
476
|
+
14,
|
|
469
477
|
"Missing property 'type' for the chosen launch configuration."
|
|
470
478
|
));
|
|
471
479
|
}
|
|
472
480
|
const actionList = [];
|
|
473
|
-
actionList.push(( (new Action('installAdditionalDebuggers', ( localizeWithPath(_moduleId,
|
|
481
|
+
actionList.push(( (new Action('installAdditionalDebuggers', ( localizeWithPath(_moduleId, 15, "Install {0} Extension", resolvedConfig.type)), undefined, true, async () => this.commandService.executeCommand('debug.installAdditionalDebuggers', resolvedConfig?.type)))));
|
|
474
482
|
await this.showError(message, actionList);
|
|
475
483
|
return false;
|
|
476
484
|
}
|
|
@@ -489,10 +497,10 @@ let DebugService = class DebugService {
|
|
|
489
497
|
if (err && err.message) {
|
|
490
498
|
await this.showError(err.message);
|
|
491
499
|
}
|
|
492
|
-
else if (this.contextService.getWorkbenchState() ===
|
|
500
|
+
else if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
|
|
493
501
|
await this.showError(( localizeWithPath(
|
|
494
502
|
_moduleId,
|
|
495
|
-
|
|
503
|
+
16,
|
|
496
504
|
"The active file can not be debugged. Make sure it is saved and that you have a debug extension installed for that file type."
|
|
497
505
|
)));
|
|
498
506
|
}
|
|
@@ -512,7 +520,7 @@ let DebugService = class DebugService {
|
|
|
512
520
|
if (options?.startedByUser && ( (this.model.getSessions().some(s => s.getLabel() === session.getLabel()))) && configuration.resolved.suppressMultipleSessionWarning !== true) {
|
|
513
521
|
const result = await this.dialogService.confirm({ message: ( localizeWithPath(
|
|
514
522
|
_moduleId,
|
|
515
|
-
|
|
523
|
+
17,
|
|
516
524
|
"'{0}' is already running. Do you want to start another instance?",
|
|
517
525
|
session.getLabel()
|
|
518
526
|
)) });
|
|
@@ -524,7 +532,7 @@ let DebugService = class DebugService {
|
|
|
524
532
|
this._onWillNewSession.fire(session);
|
|
525
533
|
const openDebug = this.configurationService.getValue('debug').openDebug;
|
|
526
534
|
if (!configuration.resolved.noDebug && (openDebug === 'openOnSessionStart' || (openDebug !== 'neverOpen' && this.viewModel.firstSessionStart)) && !session.suppressDebugView) {
|
|
527
|
-
await this.paneCompositeService.openPaneComposite(VIEWLET_ID,
|
|
535
|
+
await this.paneCompositeService.openPaneComposite(VIEWLET_ID, ViewContainerLocation.Sidebar);
|
|
528
536
|
}
|
|
529
537
|
try {
|
|
530
538
|
await this.launchOrAttachToSession(session);
|
|
@@ -582,12 +590,12 @@ let DebugService = class DebugService {
|
|
|
582
590
|
const listenerDisposables = ( (new DisposableStore()));
|
|
583
591
|
this.disposables.add(listenerDisposables);
|
|
584
592
|
const sessionRunningScheduler = listenerDisposables.add(( (new RunOnceScheduler(() => {
|
|
585
|
-
if (session.state ===
|
|
593
|
+
if (session.state === State.Running && this.viewModel.focusedSession === session) {
|
|
586
594
|
this.viewModel.setFocus(undefined, this.viewModel.focusedThread, session, false);
|
|
587
595
|
}
|
|
588
596
|
}, 200))));
|
|
589
597
|
listenerDisposables.add(session.onDidChangeState(() => {
|
|
590
|
-
if (session.state ===
|
|
598
|
+
if (session.state === State.Running && this.viewModel.focusedSession === session) {
|
|
591
599
|
sessionRunningScheduler.schedule();
|
|
592
600
|
}
|
|
593
601
|
if (session === this.viewModel.focusedSession) {
|
|
@@ -604,7 +612,7 @@ let DebugService = class DebugService {
|
|
|
604
612
|
if (adapterExitEvent.error) {
|
|
605
613
|
this.notificationService.error(( localizeWithPath(
|
|
606
614
|
_moduleId,
|
|
607
|
-
|
|
615
|
+
18,
|
|
608
616
|
"Debug adapter process has terminated unexpectedly ({0})",
|
|
609
617
|
adapterExitEvent.error.message || ( (adapterExitEvent.error.toString()))
|
|
610
618
|
)));
|
|
@@ -612,7 +620,7 @@ let DebugService = class DebugService {
|
|
|
612
620
|
this.telemetry.logDebugSessionStop(session, adapterExitEvent);
|
|
613
621
|
}
|
|
614
622
|
const extensionDebugSession = getExtensionHostDebugSession(session);
|
|
615
|
-
if (extensionDebugSession && extensionDebugSession.state ===
|
|
623
|
+
if (extensionDebugSession && extensionDebugSession.state === State.Running && extensionDebugSession.configuration.noDebug) {
|
|
616
624
|
this.extensionHostDebugService.close(extensionDebugSession.getId());
|
|
617
625
|
}
|
|
618
626
|
if (session.configuration.postDebugTask) {
|
|
@@ -627,7 +635,7 @@ let DebugService = class DebugService {
|
|
|
627
635
|
this.endInitializingState();
|
|
628
636
|
this.cancelTokens(session.getId());
|
|
629
637
|
if (this.configurationService.getValue('debug').closeReadonlyTabsOnEnd) {
|
|
630
|
-
const editorsToClose = this.editorService.getEditors(
|
|
638
|
+
const editorsToClose = this.editorService.getEditors(EditorsOrder.SEQUENTIAL).filter(({ editor }) => {
|
|
631
639
|
return editor.resource?.scheme === DEBUG_SCHEME && session.getId() === Source.getEncodedDebugData(editor.resource).sessionId;
|
|
632
640
|
});
|
|
633
641
|
this.editorService.closeEditors(editorsToClose);
|
|
@@ -640,8 +648,8 @@ let DebugService = class DebugService {
|
|
|
640
648
|
}
|
|
641
649
|
if (this.model.getSessions().length === 0) {
|
|
642
650
|
this.viewModel.setMultiSessionView(false);
|
|
643
|
-
if (this.layoutService.isVisible(
|
|
644
|
-
this.paneCompositeService.openPaneComposite(VIEWLET_ID$1,
|
|
651
|
+
if (this.layoutService.isVisible(Parts.SIDEBAR_PART) && this.configurationService.getValue('debug').openExplorerOnEnd) {
|
|
652
|
+
this.paneCompositeService.openPaneComposite(VIEWLET_ID$1, ViewContainerLocation.Sidebar);
|
|
645
653
|
}
|
|
646
654
|
const dataBreakpoints = this.model.getDataBreakpoints().filter(dbp => !dbp.canPersist);
|
|
647
655
|
dataBreakpoints.forEach(dbp => this.model.removeDataBreakpoints(dbp.getId()));
|
|
@@ -662,13 +670,13 @@ let DebugService = class DebugService {
|
|
|
662
670
|
const isAutoRestart = !!restartData;
|
|
663
671
|
const runTasks = async () => {
|
|
664
672
|
if (isAutoRestart) {
|
|
665
|
-
return Promise.resolve(
|
|
673
|
+
return Promise.resolve(TaskRunResult.Success);
|
|
666
674
|
}
|
|
667
675
|
const root = session.root || this.contextService.getWorkspace();
|
|
668
676
|
await this.taskRunner.runTask(root, session.configuration.preRestartTask);
|
|
669
677
|
await this.taskRunner.runTask(root, session.configuration.postDebugTask);
|
|
670
678
|
const taskResult1 = await this.taskRunner.runTaskAndCheckErrors(root, session.configuration.preLaunchTask);
|
|
671
|
-
if (taskResult1 !==
|
|
679
|
+
if (taskResult1 !== TaskRunResult.Success) {
|
|
672
680
|
return taskResult1;
|
|
673
681
|
}
|
|
674
682
|
return this.taskRunner.runTaskAndCheckErrors(root, session.configuration.postRestartTask);
|
|
@@ -676,7 +684,7 @@ let DebugService = class DebugService {
|
|
|
676
684
|
const extensionDebugSession = getExtensionHostDebugSession(session);
|
|
677
685
|
if (extensionDebugSession) {
|
|
678
686
|
const taskResult = await runTasks();
|
|
679
|
-
if (taskResult ===
|
|
687
|
+
if (taskResult === TaskRunResult.Success) {
|
|
680
688
|
this.extensionHostDebugService.reload(extensionDebugSession.getId());
|
|
681
689
|
}
|
|
682
690
|
return;
|
|
@@ -687,7 +695,6 @@ let DebugService = class DebugService {
|
|
|
687
695
|
if (launch) {
|
|
688
696
|
unresolved = launch.getConfiguration(session.configuration.name);
|
|
689
697
|
if (unresolved && !equals(unresolved, session.unresolvedConfiguration)) {
|
|
690
|
-
unresolved.type = session.configuration.type;
|
|
691
698
|
unresolved.noDebug = session.configuration.noDebug;
|
|
692
699
|
needsToSubstitute = true;
|
|
693
700
|
}
|
|
@@ -700,7 +707,7 @@ let DebugService = class DebugService {
|
|
|
700
707
|
if (resolvedByProviders) {
|
|
701
708
|
resolved = await this.substituteVariables(launch, resolvedByProviders);
|
|
702
709
|
if (resolved && !initCancellationToken.token.isCancellationRequested) {
|
|
703
|
-
resolved = await this.configurationManager.resolveDebugConfigurationWithSubstitutedVariables(launch && launch.workspace ? launch.workspace.uri : undefined,
|
|
710
|
+
resolved = await this.configurationManager.resolveDebugConfigurationWithSubstitutedVariables(launch && launch.workspace ? launch.workspace.uri : undefined, resolved.type, resolved, initCancellationToken.token);
|
|
704
711
|
}
|
|
705
712
|
}
|
|
706
713
|
else {
|
|
@@ -730,7 +737,7 @@ let DebugService = class DebugService {
|
|
|
730
737
|
};
|
|
731
738
|
if (session.capabilities.supportsRestartRequest) {
|
|
732
739
|
const taskResult = await runTasks();
|
|
733
|
-
if (taskResult ===
|
|
740
|
+
if (taskResult === TaskRunResult.Success) {
|
|
734
741
|
await doRestart(async () => {
|
|
735
742
|
await session.restart();
|
|
736
743
|
return true;
|
|
@@ -750,7 +757,7 @@ let DebugService = class DebugService {
|
|
|
750
757
|
(new Promise((c, e) => {
|
|
751
758
|
setTimeout(async () => {
|
|
752
759
|
const taskResult = await runTasks();
|
|
753
|
-
if (taskResult !==
|
|
760
|
+
if (taskResult !== TaskRunResult.Success) {
|
|
754
761
|
return c(false);
|
|
755
762
|
}
|
|
756
763
|
if (!resolved) {
|
|
@@ -841,7 +848,7 @@ let DebugService = class DebugService {
|
|
|
841
848
|
const lineContent = control.getModel().getLineContent(lineNumber);
|
|
842
849
|
alert(( localizeWithPath(
|
|
843
850
|
_moduleId,
|
|
844
|
-
|
|
851
|
+
19,
|
|
845
852
|
"{0}, debugging paused {1}, {2}:{3}",
|
|
846
853
|
lineContent,
|
|
847
854
|
thread && thread.stoppedDetails ? `, reason ${thread.stoppedDetails.reason}` : '',
|
|
@@ -916,7 +923,7 @@ let DebugService = class DebugService {
|
|
|
916
923
|
if (ariaAnnounce) {
|
|
917
924
|
breakpoints.forEach(bp => status(( localizeWithPath(
|
|
918
925
|
_moduleId,
|
|
919
|
-
|
|
926
|
+
20,
|
|
920
927
|
"Added breakpoint, line {0}, file {1}",
|
|
921
928
|
bp.lineNumber,
|
|
922
929
|
uri.fsPath
|
|
@@ -943,7 +950,7 @@ let DebugService = class DebugService {
|
|
|
943
950
|
const toRemove = breakpoints.filter(bp => !id || bp.getId() === id);
|
|
944
951
|
toRemove.forEach(bp => status(( localizeWithPath(
|
|
945
952
|
_moduleId,
|
|
946
|
-
|
|
953
|
+
21,
|
|
947
954
|
"Removed breakpoint, line {0}, file {1}",
|
|
948
955
|
bp.lineNumber,
|
|
949
956
|
bp.uri.fsPath
|
|
@@ -960,8 +967,13 @@ let DebugService = class DebugService {
|
|
|
960
967
|
this.model.setBreakpointsActivated(activated);
|
|
961
968
|
return this.sendAllBreakpoints();
|
|
962
969
|
}
|
|
963
|
-
addFunctionBreakpoint(
|
|
964
|
-
this.model.addFunctionBreakpoint(name
|
|
970
|
+
async addFunctionBreakpoint(opts, id) {
|
|
971
|
+
this.model.addFunctionBreakpoint(opts ?? { name: '' }, id);
|
|
972
|
+
if (opts) {
|
|
973
|
+
this.debugStorage.storeBreakpoints(this.model);
|
|
974
|
+
await this.sendFunctionBreakpoints();
|
|
975
|
+
this.debugStorage.storeBreakpoints(this.model);
|
|
976
|
+
}
|
|
965
977
|
}
|
|
966
978
|
async updateFunctionBreakpoint(id, update) {
|
|
967
979
|
this.model.updateFunctionBreakpoint(id, update);
|
|
@@ -1103,13 +1115,13 @@ let DebugService = class DebugService {
|
|
|
1103
1115
|
});
|
|
1104
1116
|
}
|
|
1105
1117
|
onFileChanges(fileChangesEvent) {
|
|
1106
|
-
const toRemove = this.model.getBreakpoints().filter(bp => fileChangesEvent.contains(bp.originalUri,
|
|
1118
|
+
const toRemove = this.model.getBreakpoints().filter(bp => fileChangesEvent.contains(bp.originalUri, FileChangeType.DELETED));
|
|
1107
1119
|
if (toRemove.length) {
|
|
1108
1120
|
this.model.removeBreakpoints(toRemove);
|
|
1109
1121
|
}
|
|
1110
1122
|
const toSend = [];
|
|
1111
1123
|
for (const uri of this.breakpointsToSendOnResourceSaved) {
|
|
1112
|
-
if (fileChangesEvent.contains(uri,
|
|
1124
|
+
if (fileChangesEvent.contains(uri, FileChangeType.UPDATED)) {
|
|
1113
1125
|
toSend.push(uri);
|
|
1114
1126
|
}
|
|
1115
1127
|
}
|
|
@@ -1135,7 +1147,7 @@ let DebugService = class DebugService {
|
|
|
1135
1147
|
return { threadToContinue, breakpointToRemove };
|
|
1136
1148
|
};
|
|
1137
1149
|
const removeTempBreakPoint = (state) => {
|
|
1138
|
-
if (state ===
|
|
1150
|
+
if (state === State.Stopped || state === State.Inactive) {
|
|
1139
1151
|
if (breakpointToRemove) {
|
|
1140
1152
|
this.removeBreakpoints(breakpointToRemove.getId());
|
|
1141
1153
|
}
|
|
@@ -1144,7 +1156,7 @@ let DebugService = class DebugService {
|
|
|
1144
1156
|
return false;
|
|
1145
1157
|
};
|
|
1146
1158
|
await addTempBreakPoint();
|
|
1147
|
-
if (this.state ===
|
|
1159
|
+
if (this.state === State.Inactive) {
|
|
1148
1160
|
const { launch, name, getConfig } = this.getConfigurationManager().selectedConfiguration;
|
|
1149
1161
|
const config = await getConfig();
|
|
1150
1162
|
const configOrName = config ? Object.assign(deepClone(config), {}) : name;
|
|
@@ -1155,7 +1167,7 @@ let DebugService = class DebugService {
|
|
|
1155
1167
|
});
|
|
1156
1168
|
await this.startDebugging(launch, configOrName, undefined, true);
|
|
1157
1169
|
}
|
|
1158
|
-
if (this.state ===
|
|
1170
|
+
if (this.state === State.Stopped) {
|
|
1159
1171
|
const focusedSession = this.getViewModel().focusedSession;
|
|
1160
1172
|
if (!focusedSession || !threadToContinue) {
|
|
1161
1173
|
return;
|
|
@@ -1187,33 +1199,40 @@ let DebugService = class DebugService {
|
|
|
1187
1199
|
}))), 2000);
|
|
1188
1200
|
listener.dispose();
|
|
1189
1201
|
}
|
|
1202
|
+
let Score;
|
|
1203
|
+
( ((function(Score) {
|
|
1204
|
+
Score[Score["Focused"] = 0] = "Focused";
|
|
1205
|
+
Score[Score["Verified"] = 1] = "Verified";
|
|
1206
|
+
Score[Score["VerifiedAndPausedInFile"] = 2] = "VerifiedAndPausedInFile";
|
|
1207
|
+
Score[Score["VerifiedAndFocused"] = 3] = "VerifiedAndFocused";
|
|
1208
|
+
})(Score || (Score = {}))));
|
|
1190
1209
|
let bestThread = viewModel.focusedThread;
|
|
1191
|
-
let bestScore =
|
|
1210
|
+
let bestScore = Score.Focused;
|
|
1192
1211
|
for (const sessionId of breakpoint.sessionsThatVerified) {
|
|
1193
1212
|
const session = debugModel.getSession(sessionId);
|
|
1194
1213
|
if (!session) {
|
|
1195
1214
|
continue;
|
|
1196
1215
|
}
|
|
1197
1216
|
const threads = session.getAllThreads().filter(t => t.stopped);
|
|
1198
|
-
if (bestScore <
|
|
1217
|
+
if (bestScore < Score.VerifiedAndFocused) {
|
|
1199
1218
|
if (viewModel.focusedThread && threads.includes(viewModel.focusedThread)) {
|
|
1200
1219
|
bestThread = viewModel.focusedThread;
|
|
1201
|
-
bestScore =
|
|
1220
|
+
bestScore = Score.VerifiedAndFocused;
|
|
1202
1221
|
}
|
|
1203
1222
|
}
|
|
1204
|
-
if (bestScore <
|
|
1223
|
+
if (bestScore < Score.VerifiedAndPausedInFile) {
|
|
1205
1224
|
const pausedInThisFile = threads.find(t => {
|
|
1206
1225
|
const top = t.getTopStackFrame();
|
|
1207
1226
|
return top && this.uriIdentityService.extUri.isEqual(top.source.uri, uri);
|
|
1208
1227
|
});
|
|
1209
1228
|
if (pausedInThisFile) {
|
|
1210
1229
|
bestThread = pausedInThisFile;
|
|
1211
|
-
bestScore =
|
|
1230
|
+
bestScore = Score.VerifiedAndPausedInFile;
|
|
1212
1231
|
}
|
|
1213
1232
|
}
|
|
1214
|
-
if (bestScore <
|
|
1233
|
+
if (bestScore < Score.Verified) {
|
|
1215
1234
|
bestThread = threads[0];
|
|
1216
|
-
bestScore =
|
|
1235
|
+
bestScore = Score.VerifiedAndPausedInFile;
|
|
1217
1236
|
}
|
|
1218
1237
|
}
|
|
1219
1238
|
return { thread: bestThread, breakpoint };
|
|
@@ -1248,7 +1267,7 @@ function getStackFrameThreadAndSessionToFocus(model, stackFrame, thread, session
|
|
|
1248
1267
|
}
|
|
1249
1268
|
else {
|
|
1250
1269
|
const sessions = model.getSessions();
|
|
1251
|
-
const stoppedSession = sessions.find(s => s.state ===
|
|
1270
|
+
const stoppedSession = sessions.find(s => s.state === State.Stopped);
|
|
1252
1271
|
session = stoppedSession || sessions.find(s => s !== avoidSession && s !== avoidSession?.parentSession) || (sessions.length ? sessions[0] : undefined);
|
|
1253
1272
|
}
|
|
1254
1273
|
}
|
|
@@ -19,11 +19,13 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/c
|
|
|
19
19
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
20
20
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
21
21
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
22
|
+
import { TelemetryLevel } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
22
23
|
import { ITelemetryService, ICustomEndpointTelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
23
24
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
24
25
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
26
|
+
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
25
27
|
import { RawDebugSession } from './rawDebugSession.js';
|
|
26
|
-
import { VIEWLET_ID, isFrameDeemphasized } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
28
|
+
import { State, VIEWLET_ID, isFrameDeemphasized } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
27
29
|
import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug.service';
|
|
28
30
|
import { MemoryRegion, ExpressionContainer, Thread } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
|
|
29
31
|
import { Source } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugSource';
|
|
@@ -99,7 +101,7 @@ let DebugSession = class DebugSession {
|
|
|
99
101
|
toDispose.add(compoundRoot.onDidSessionStop(() => this.terminate()));
|
|
100
102
|
}
|
|
101
103
|
this.passFocusScheduler = ( (new RunOnceScheduler(() => {
|
|
102
|
-
if (( (this.debugService.getModel().getSessions().some(s => s.state ===
|
|
104
|
+
if (( (this.debugService.getModel().getSessions().some(s => s.state === State.Stopped))) || ( (this.getAllThreads().some(t => t.stopped)))) {
|
|
103
105
|
if (typeof this.lastContinuedThreadId === 'number') {
|
|
104
106
|
const thread = this.debugService.getViewModel().focusedThread;
|
|
105
107
|
if (thread && thread.threadId === this.lastContinuedThreadId && !thread.stopped) {
|
|
@@ -110,7 +112,7 @@ let DebugSession = class DebugSession {
|
|
|
110
112
|
}
|
|
111
113
|
else {
|
|
112
114
|
const session = this.debugService.getViewModel().focusedSession;
|
|
113
|
-
if (session && session.getId() === this.getId() && session.state !==
|
|
115
|
+
if (session && session.getId() === this.getId() && session.state !== State.Stopped) {
|
|
114
116
|
this.debugService.focusStackFrame(undefined);
|
|
115
117
|
}
|
|
116
118
|
}
|
|
@@ -187,19 +189,19 @@ let DebugSession = class DebugSession {
|
|
|
187
189
|
}
|
|
188
190
|
get state() {
|
|
189
191
|
if (!this.initialized) {
|
|
190
|
-
return
|
|
192
|
+
return State.Initializing;
|
|
191
193
|
}
|
|
192
194
|
if (!this.raw) {
|
|
193
|
-
return
|
|
195
|
+
return State.Inactive;
|
|
194
196
|
}
|
|
195
197
|
const focusedThread = this.debugService.getViewModel().focusedThread;
|
|
196
198
|
if (focusedThread && focusedThread.session === this) {
|
|
197
|
-
return focusedThread.stopped ?
|
|
199
|
+
return focusedThread.stopped ? State.Stopped : State.Running;
|
|
198
200
|
}
|
|
199
201
|
if (( (this.getAllThreads().some(t => t.stopped)))) {
|
|
200
|
-
return
|
|
202
|
+
return State.Stopped;
|
|
201
203
|
}
|
|
202
|
-
return
|
|
204
|
+
return State.Running;
|
|
203
205
|
}
|
|
204
206
|
get capabilities() {
|
|
205
207
|
return this.raw ? this.raw.capabilities : Object.create(null);
|
|
@@ -282,7 +284,7 @@ let DebugSession = class DebugSession {
|
|
|
282
284
|
'launch or attach'
|
|
283
285
|
))));
|
|
284
286
|
}
|
|
285
|
-
if (this.parentSession && this.parentSession.state ===
|
|
287
|
+
if (this.parentSession && this.parentSession.state === State.Inactive) {
|
|
286
288
|
throw canceled();
|
|
287
289
|
}
|
|
288
290
|
config.__sessionId = this.getId();
|
|
@@ -1000,7 +1002,7 @@ let DebugSession = class DebugSession {
|
|
|
1000
1002
|
}
|
|
1001
1003
|
if (event.body.category === 'telemetry') {
|
|
1002
1004
|
const telemetryEndpoint = this.raw.dbgr.getCustomTelemetryEndpoint();
|
|
1003
|
-
if (telemetryEndpoint && this.telemetryService.telemetryLevel !==
|
|
1005
|
+
if (telemetryEndpoint && this.telemetryService.telemetryLevel !== TelemetryLevel.NONE) {
|
|
1004
1006
|
let data = event.body.data;
|
|
1005
1007
|
if (!telemetryEndpoint.sendErrorTelemetry && event.body.data) {
|
|
1006
1008
|
data = filterExceptionsFromTelemetry(event.body.data);
|
|
@@ -1143,7 +1145,7 @@ let DebugSession = class DebugSession {
|
|
|
1143
1145
|
}
|
|
1144
1146
|
if (thread.stoppedDetails && !token.isCancellationRequested) {
|
|
1145
1147
|
if (thread.stoppedDetails.reason === 'breakpoint' && this.configurationService.getValue('debug').openDebug === 'openOnDebugBreak' && !this.suppressDebugView) {
|
|
1146
|
-
await this.paneCompositeService.openPaneComposite(VIEWLET_ID,
|
|
1148
|
+
await this.paneCompositeService.openPaneComposite(VIEWLET_ID, ViewContainerLocation.Sidebar);
|
|
1147
1149
|
}
|
|
1148
1150
|
if (this.configurationService.getValue('debug').focusWindowOnBreak && !this.workbenchEnvironmentService.extensionTestsLocationURI) {
|
|
1149
1151
|
const activeWindow = getActiveWindow();
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { State } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
4
5
|
import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug.service';
|
|
5
6
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { StatusbarAlignment } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
6
8
|
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
7
9
|
|
|
8
10
|
const _moduleId = "vs/workbench/contrib/debug/browser/debugStatus";
|
|
@@ -12,7 +14,7 @@ let DebugStatusContribution = class DebugStatusContribution {
|
|
|
12
14
|
this.debugService = debugService;
|
|
13
15
|
this.toDispose = [];
|
|
14
16
|
const addStatusBarEntry = () => {
|
|
15
|
-
this.entryAccessor = this.statusBarService.addEntry(this.entry, 'status.debug',
|
|
17
|
+
this.entryAccessor = this.statusBarService.addEntry(this.entry, 'status.debug', StatusbarAlignment.LEFT, 30 );
|
|
16
18
|
};
|
|
17
19
|
const setShowInStatusBar = () => {
|
|
18
20
|
this.showInStatusBar = configurationService.getValue('debug').showInStatusBar;
|
|
@@ -22,7 +24,7 @@ let DebugStatusContribution = class DebugStatusContribution {
|
|
|
22
24
|
};
|
|
23
25
|
setShowInStatusBar();
|
|
24
26
|
this.toDispose.push(this.debugService.onDidChangeState(state => {
|
|
25
|
-
if (state !==
|
|
27
|
+
if (state !== State.Inactive && this.showInStatusBar === 'onFirstSessionStart' && !this.entryAccessor) {
|
|
26
28
|
addStatusBarEntry();
|
|
27
29
|
}
|
|
28
30
|
}));
|