mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-17 09:23:32 +01:00
Update editor configuration only after extensions are registered (#138302)
* delay updating editor configurations when installe extensions are registered * async function over Promise.then Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ff970e88e5
commit
cbab504ea9
@@ -11,6 +11,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions, IConfigu
|
||||
import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration';
|
||||
import { IEditorResolverService, RegisteredEditorInfo, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService';
|
||||
import { IJSONSchemaMap } from 'vs/base/common/jsonSchema';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
|
||||
export class DynamicEditorGroupAutoLockConfiguration extends Disposable implements IWorkbenchContribution {
|
||||
|
||||
@@ -32,12 +33,21 @@ export class DynamicEditorGroupAutoLockConfiguration extends Disposable implemen
|
||||
private configurationNode: IConfigurationNode | undefined;
|
||||
|
||||
constructor(
|
||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService
|
||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
||||
@IExtensionService extensionService: IExtensionService,
|
||||
) {
|
||||
super();
|
||||
|
||||
this.updateConfiguration();
|
||||
this.registerListeners();
|
||||
// Editor configurations are getting updated very aggressively
|
||||
// (atleast 20 times) while the extensions are getting registered.
|
||||
// As such push out the dynamic editor auto lock configuration
|
||||
// until after extensions registered.
|
||||
(async ()=> {
|
||||
await extensionService.whenInstalledExtensionsRegistered();
|
||||
|
||||
this.updateConfiguration();
|
||||
this.registerListeners();
|
||||
})();
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
|
||||
Reference in New Issue
Block a user