@@ -365,7 +365,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
365
365
const application = await this . reloadApplicationConfiguration ( true ) ;
366
366
const { local, remote } = await this . reloadUserConfiguration ( ) ;
367
367
await this . reloadWorkspaceConfiguration ( ) ;
368
- await this . loadConfiguration ( application , local , remote ) ;
368
+ await this . loadConfiguration ( application , local , remote , true ) ;
369
369
return ;
370
370
}
371
371
@@ -381,7 +381,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
381
381
382
382
case ConfigurationTarget . USER : {
383
383
const { local, remote } = await this . reloadUserConfiguration ( ) ;
384
- await this . loadConfiguration ( this . _configuration . applicationConfiguration , local , remote ) ;
384
+ await this . loadConfiguration ( this . _configuration . applicationConfiguration , local , remote , true ) ;
385
385
return ;
386
386
}
387
387
case ConfigurationTarget . USER_LOCAL :
@@ -436,8 +436,10 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
436
436
async initialize ( arg : IAnyWorkspaceIdentifier ) : Promise < void > {
437
437
mark ( 'code/willInitWorkspaceService' ) ;
438
438
439
+ const trigger = this . initialized ;
440
+ this . initialized = false ;
439
441
const workspace = await this . createWorkspace ( arg ) ;
440
- await this . updateWorkspaceAndInitializeConfiguration ( workspace ) ;
442
+ await this . updateWorkspaceAndInitializeConfiguration ( workspace , trigger ) ;
441
443
this . checkAndMarkWorkspaceComplete ( false ) ;
442
444
443
445
mark ( 'code/didInitWorkspaceService' ) ;
@@ -529,7 +531,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
529
531
}
530
532
}
531
533
532
- private async updateWorkspaceAndInitializeConfiguration ( workspace : Workspace ) : Promise < void > {
534
+ private async updateWorkspaceAndInitializeConfiguration ( workspace : Workspace , trigger : boolean ) : Promise < void > {
533
535
const hasWorkspaceBefore = ! ! this . workspace ;
534
536
let previousState : WorkbenchState | undefined ;
535
537
let previousWorkspacePath : string | undefined ;
@@ -544,7 +546,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
544
546
this . workspace = workspace ;
545
547
}
546
548
547
- await this . initializeConfiguration ( ) ;
549
+ await this . initializeConfiguration ( trigger ) ;
548
550
549
551
// Trigger changes after configuration initialization so that configuration is up to date.
550
552
if ( hasWorkspaceBefore ) {
@@ -589,7 +591,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
589
591
return result ;
590
592
}
591
593
592
- private async initializeConfiguration ( ) : Promise < void > {
594
+ private async initializeConfiguration ( trigger : boolean ) : Promise < void > {
593
595
await this . defaultConfiguration . initialize ( ) ;
594
596
595
597
const [ , application , user ] = await Promise . all ( [
@@ -604,7 +606,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
604
606
] ) ;
605
607
606
608
mark ( 'code/willInitWorkspaceConfiguration' ) ;
607
- await this . loadConfiguration ( application , user . local , user . remote ) ;
609
+ await this . loadConfiguration ( application , user . local , user . remote , trigger ) ;
608
610
mark ( 'code/didInitWorkspaceConfiguration' ) ;
609
611
}
610
612
@@ -670,7 +672,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
670
672
return this . onWorkspaceFolderConfigurationChanged ( folder ) ;
671
673
}
672
674
673
- private async loadConfiguration ( applicationConfigurationModel : ConfigurationModel , userConfigurationModel : ConfigurationModel , remoteUserConfigurationModel : ConfigurationModel ) : Promise < void > {
675
+ private async loadConfiguration ( applicationConfigurationModel : ConfigurationModel , userConfigurationModel : ConfigurationModel , remoteUserConfigurationModel : ConfigurationModel , trigger : boolean ) : Promise < void > {
674
676
// reset caches
675
677
this . cachedFolderConfigs = new ResourceMap < FolderConfiguration > ( ) ;
676
678
@@ -684,11 +686,11 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
684
686
const currentConfiguration = this . _configuration ;
685
687
this . _configuration = new Configuration ( this . defaultConfiguration . configurationModel , this . policyConfiguration . configurationModel , applicationConfigurationModel , userConfigurationModel , remoteUserConfigurationModel , workspaceConfiguration , folderConfigurationModels , new ConfigurationModel ( ) , new ResourceMap < ConfigurationModel > ( ) , this . workspace ) ;
686
688
687
- if ( this . initialized ) {
689
+ this . initialized = true ;
690
+
691
+ if ( trigger ) {
688
692
const change = this . _configuration . compare ( currentConfiguration ) ;
689
693
this . triggerConfigurationChange ( change , { data : currentConfiguration . toData ( ) , workspace : this . workspace } , ConfigurationTarget . WORKSPACE ) ;
690
- } else {
691
- this . initialized = true ;
692
694
}
693
695
694
696
this . updateRestrictedSettings ( ) ;
@@ -722,7 +724,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
722
724
}
723
725
}
724
726
const [ localUser , application ] = await Promise . all ( promises ) ;
725
- await this . loadConfiguration ( application ?? this . _configuration . applicationConfiguration , localUser , this . _configuration . remoteUserConfiguration ) ;
727
+ await this . loadConfiguration ( application ?? this . _configuration . applicationConfiguration , localUser , this . _configuration . remoteUserConfiguration , true ) ;
726
728
} ) ( ) ) ;
727
729
}
728
730
0 commit comments