66import * as aria from 'vs/base/browser/ui/aria/aria' ;
77import { Action , IAction } from 'vs/base/common/actions' ;
88import { 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' ;
1010import { CancellationTokenSource } from 'vs/base/common/cancellation' ;
1111import { isErrorWithActions } from 'vs/base/common/errorMessage' ;
1212import * as errors from 'vs/base/common/errors' ;
@@ -85,8 +85,6 @@ export class DebugService implements IDebugService {
8585 private activity : IDisposable | undefined ;
8686 private chosenEnvironments : { [ key : string ] : string } ;
8787
88- private configResolverQueue = new Queue < IConfig | null | undefined > ( ) ;
89-
9088 constructor (
9189 @IEditorService private readonly editorService : IEditorService ,
9290 @IPaneCompositePartService private readonly paneCompositeService : IPaneCompositePartService ,
@@ -447,7 +445,7 @@ export class DebugService implements IDebugService {
447445 const sessionId = generateUuid ( ) ;
448446 this . sessionCancellationTokens . set ( sessionId , initCancellationToken ) ;
449447
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 ) ;
451449 // a falsy config indicates an aborted launch
452450 if ( configByProviders && configByProviders . type ) {
453451 try {
@@ -468,7 +466,7 @@ export class DebugService implements IDebugService {
468466 return false ;
469467 }
470468
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 ) ;
472470 if ( ! cfg ) {
473471 if ( launch && type && cfg === null && ! initCancellationToken . token . isCancellationRequested ) { // show launch.json only for "config" being "null".
474472 await launch . openConfigFile ( { preserveFocus : true , type } , initCancellationToken . token ) ;
@@ -753,11 +751,11 @@ export class DebugService implements IDebugService {
753751 if ( launch && needsToSubstitute && unresolved ) {
754752 const initCancellationToken = new CancellationTokenSource ( ) ;
755753 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 ) ;
757755 if ( resolvedByProviders ) {
758756 resolved = await this . substituteVariables ( launch , resolvedByProviders ) ;
759757 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 ) ;
761759 }
762760 } else {
763761 resolved = resolvedByProviders ;
@@ -824,7 +822,7 @@ export class DebugService implements IDebugService {
824822 return Promise . all ( sessions . map ( s => disconnect ? s . disconnect ( undefined , suspend ) : s . terminate ( ) ) ) ;
825823 }
826824
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 > {
828826 const dbg = this . adapterManager . getDebugger ( config . type ) ;
829827 if ( dbg ) {
830828 let folder : IWorkspaceFolder | undefined = undefined ;
@@ -837,7 +835,7 @@ export class DebugService implements IDebugService {
837835 }
838836 }
839837 try {
840- return this . configResolverQueue . queue ( ( ) => dbg . substituteVariables ( folder , config ) ) ;
838+ return await dbg . substituteVariables ( folder , config ) ;
841839 } catch ( err ) {
842840 this . showError ( err . message , undefined , ! ! launch ?. getConfiguration ( config . name ) ) ;
843841 return undefined ; // bail out
0 commit comments