6
6
import * as aria from 'vs/base/browser/ui/aria/aria' ;
7
7
import { Action , IAction } from 'vs/base/common/actions' ;
8
8
import { distinct } from 'vs/base/common/arrays' ;
9
- import { Queue , raceTimeout , RunOnceScheduler } from 'vs/base/common/async' ;
9
+ import { raceTimeout , RunOnceScheduler } from 'vs/base/common/async' ;
10
10
import { CancellationTokenSource } from 'vs/base/common/cancellation' ;
11
11
import { isErrorWithActions } from 'vs/base/common/errorMessage' ;
12
12
import * as errors from 'vs/base/common/errors' ;
@@ -85,8 +85,6 @@ export class DebugService implements IDebugService {
85
85
private activity : IDisposable | undefined ;
86
86
private chosenEnvironments : { [ key : string ] : string } ;
87
87
88
- private configResolverQueue = new Queue < IConfig | null | undefined > ( ) ;
89
-
90
88
constructor (
91
89
@IEditorService private readonly editorService : IEditorService ,
92
90
@IPaneCompositePartService private readonly paneCompositeService : IPaneCompositePartService ,
@@ -447,7 +445,7 @@ export class DebugService implements IDebugService {
447
445
const sessionId = generateUuid ( ) ;
448
446
this . sessionCancellationTokens . set ( sessionId , initCancellationToken ) ;
449
447
450
- const configByProviders = await this . configResolverQueue . queue ( ( ) => this . configurationManager . resolveConfigurationByProviders ( launch && launch . workspace ? launch . workspace . uri : undefined , type , config ! , initCancellationToken . token ) ) ;
448
+ const configByProviders = await this . configurationManager . resolveConfigurationByProviders ( launch && launch . workspace ? launch . workspace . uri : undefined , type , config ! , initCancellationToken . token ) ;
451
449
// a falsy config indicates an aborted launch
452
450
if ( configByProviders && configByProviders . type ) {
453
451
try {
@@ -468,7 +466,7 @@ export class DebugService implements IDebugService {
468
466
return false ;
469
467
}
470
468
471
- const cfg = await this . configResolverQueue . queue ( ( ) => this . configurationManager . resolveDebugConfigurationWithSubstitutedVariables ( launch && launch . workspace ? launch . workspace . uri : undefined , type , resolvedConfig ! , initCancellationToken . token ) ) ;
469
+ const cfg = await this . configurationManager . resolveDebugConfigurationWithSubstitutedVariables ( launch && launch . workspace ? launch . workspace . uri : undefined , type , resolvedConfig , initCancellationToken . token ) ;
472
470
if ( ! cfg ) {
473
471
if ( launch && type && cfg === null && ! initCancellationToken . token . isCancellationRequested ) { // show launch.json only for "config" being "null".
474
472
await launch . openConfigFile ( { preserveFocus : true , type } , initCancellationToken . token ) ;
@@ -753,11 +751,11 @@ export class DebugService implements IDebugService {
753
751
if ( launch && needsToSubstitute && unresolved ) {
754
752
const initCancellationToken = new CancellationTokenSource ( ) ;
755
753
this . sessionCancellationTokens . set ( session . getId ( ) , initCancellationToken ) ;
756
- const resolvedByProviders = await this . configResolverQueue . queue ( ( ) => this . configurationManager . resolveConfigurationByProviders ( launch . workspace ? launch . workspace . uri : undefined , unresolved ! . type , unresolved ! , initCancellationToken . token ) ) ;
754
+ const resolvedByProviders = await this . configurationManager . resolveConfigurationByProviders ( launch . workspace ? launch . workspace . uri : undefined , unresolved . type , unresolved , initCancellationToken . token ) ;
757
755
if ( resolvedByProviders ) {
758
756
resolved = await this . substituteVariables ( launch , resolvedByProviders ) ;
759
757
if ( resolved && ! initCancellationToken . token . isCancellationRequested ) {
760
- resolved = await this . configResolverQueue . queue ( ( ) => this . configurationManager . resolveDebugConfigurationWithSubstitutedVariables ( launch && launch . workspace ? launch . workspace . uri : undefined , unresolved ! . type , resolved ! , initCancellationToken . token ) ) ;
758
+ resolved = await this . configurationManager . resolveDebugConfigurationWithSubstitutedVariables ( launch && launch . workspace ? launch . workspace . uri : undefined , unresolved . type , resolved , initCancellationToken . token ) ;
761
759
}
762
760
} else {
763
761
resolved = resolvedByProviders ;
@@ -824,7 +822,7 @@ export class DebugService implements IDebugService {
824
822
return Promise . all ( sessions . map ( s => disconnect ? s . disconnect ( undefined , suspend ) : s . terminate ( ) ) ) ;
825
823
}
826
824
827
- private async substituteVariables ( launch : ILaunch | undefined , config : IConfig ) : Promise < IConfig | null | undefined > {
825
+ private async substituteVariables ( launch : ILaunch | undefined , config : IConfig ) : Promise < IConfig | undefined > {
828
826
const dbg = this . adapterManager . getDebugger ( config . type ) ;
829
827
if ( dbg ) {
830
828
let folder : IWorkspaceFolder | undefined = undefined ;
@@ -837,7 +835,7 @@ export class DebugService implements IDebugService {
837
835
}
838
836
}
839
837
try {
840
- return this . configResolverQueue . queue ( ( ) => dbg . substituteVariables ( folder , config ) ) ;
838
+ return await dbg . substituteVariables ( folder , config ) ;
841
839
} catch ( err ) {
842
840
this . showError ( err . message , undefined , ! ! launch ?. getConfiguration ( config . name ) ) ;
843
841
return undefined ; // bail out
0 commit comments