Skip to content

Commit cbab504

Browse files
sandy081bpasero
andauthored
Update editor configuration only after extensions are registered (microsoft#138302)
* delay updating editor configurations when installe extensions are registered * async function over Promise.then Co-authored-by: Benjamin Pasero <[email protected]>
1 parent ff970e8 commit cbab504

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/vs/workbench/browser/parts/editor/editorConfiguration.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions, IConfigu
1111
import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration';
1212
import { IEditorResolverService, RegisteredEditorInfo, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService';
1313
import { IJSONSchemaMap } from 'vs/base/common/jsonSchema';
14+
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
1415

1516
export class DynamicEditorGroupAutoLockConfiguration extends Disposable implements IWorkbenchContribution {
1617

@@ -32,12 +33,21 @@ export class DynamicEditorGroupAutoLockConfiguration extends Disposable implemen
3233
private configurationNode: IConfigurationNode | undefined;
3334

3435
constructor(
35-
@IEditorResolverService private readonly editorResolverService: IEditorResolverService
36+
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
37+
@IExtensionService extensionService: IExtensionService,
3638
) {
3739
super();
3840

39-
this.updateConfiguration();
40-
this.registerListeners();
41+
// Editor configurations are getting updated very aggressively
42+
// (atleast 20 times) while the extensions are getting registered.
43+
// As such push out the dynamic editor auto lock configuration
44+
// until after extensions registered.
45+
(async ()=> {
46+
await extensionService.whenInstalledExtensionsRegistered();
47+
48+
this.updateConfiguration();
49+
this.registerListeners();
50+
})();
4151
}
4252

4353
private registerListeners(): void {

0 commit comments

Comments
 (0)