@@ -79,7 +79,7 @@ export class ConfigurationManager implements IConfigurationManager {
7979 this . initLaunches ( ) ;
8080 this . registerListeners ( ) ;
8181 const previousSelectedRoot = this . storageService . get ( DEBUG_SELECTED_ROOT , StorageScope . WORKSPACE ) ;
82- const previousSelectedLaunch = this . launches . filter ( l => l . uri . toString ( ) === previousSelectedRoot ) . pop ( ) ;
82+ const previousSelectedLaunch = this . launches . find ( l => l . uri . toString ( ) === previousSelectedRoot ) ;
8383 this . debugConfigurationTypeContext = CONTEXT_DEBUG_CONFIGURATION_TYPE . bindTo ( contextKeyService ) ;
8484 if ( previousSelectedLaunch && previousSelectedLaunch . getConfigurationNames ( ) . length ) {
8585 this . selectConfiguration ( previousSelectedLaunch , this . storageService . get ( DEBUG_SELECTED_CONFIG_NAME_KEY , StorageScope . WORKSPACE ) ) ;
@@ -202,8 +202,8 @@ export class ConfigurationManager implements IConfigurationManager {
202202 triggerKind = DebugConfigurationProviderTriggerKind . Initial ;
203203 }
204204 // check if there are providers for the given type that contribute a provideDebugConfigurations method
205- const providers = this . configProviders . filter ( p => p . provideDebugConfigurations && ( p . type === debugType ) && ( p . triggerKind === triggerKind ) ) ;
206- return providers . length > 0 ;
205+ const provider = this . configProviders . find ( p => p . provideDebugConfigurations && ( p . type === debugType ) && ( p . triggerKind === triggerKind ) ) ;
206+ return ! ! provider ;
207207 }
208208
209209 async resolveConfigurationByProviders ( folderUri : uri | undefined , type : string | undefined , config : IConfig , token : CancellationToken ) : Promise < IConfig | null | undefined > {
@@ -416,7 +416,7 @@ export class ConfigurationManager implements IConfigurationManager {
416416 return undefined ;
417417 }
418418
419- return this . launches . filter ( l => l . workspace && l . workspace . uri . toString ( ) === workspaceUri . toString ( ) ) . pop ( ) ;
419+ return this . launches . find ( l => l . workspace && l . workspace . uri . toString ( ) === workspaceUri . toString ( ) ) ;
420420 }
421421
422422 get selectedConfiguration ( ) : { launch : ILaunch | undefined , name : string | undefined } {
@@ -490,11 +490,11 @@ export class ConfigurationManager implements IConfigurationManager {
490490 }
491491
492492 getDebugger ( type : string ) : Debugger | undefined {
493- return this . debuggers . filter ( dbg => strings . equalsIgnoreCase ( dbg . type , type ) ) . pop ( ) ;
493+ return this . debuggers . find ( dbg => strings . equalsIgnoreCase ( dbg . type , type ) ) ;
494494 }
495495
496496 isDebuggerInterestedInLanguage ( language : string ) : boolean {
497- return this . debuggers . filter ( a => language && a . languages && a . languages . indexOf ( language ) >= 0 ) . length > 0 ;
497+ return ! ! this . debuggers . find ( a => language && a . languages && a . languages . indexOf ( language ) >= 0 ) ;
498498 }
499499
500500 async guessDebugger ( type ?: string ) : Promise < Debugger | undefined > {
@@ -571,7 +571,7 @@ abstract class AbstractLaunch {
571571 return undefined ;
572572 }
573573
574- return config . compounds . filter ( compound => compound . name === name ) . pop ( ) ;
574+ return config . compounds . find ( compound => compound . name === name ) ;
575575 }
576576
577577 getConfigurationNames ( ignoreCompoundsAndPresentation = false ) : string [ ] {
@@ -602,7 +602,7 @@ abstract class AbstractLaunch {
602602 return undefined ;
603603 }
604604
605- return config . configurations . filter ( config => config && config . name === name ) . shift ( ) ;
605+ return config . configurations . find ( config => config && config . name === name ) ;
606606 }
607607
608608 get hidden ( ) : boolean {
0 commit comments