提交 a50744bf 编写于 作者: S Sandeep Somavarapu

Fix #32558

上级 eb4e09ba
......@@ -537,14 +537,14 @@ export class WorkspaceServiceImpl extends WorkspaceService {
}
private onFoldersChanged(): void {
let configurationChanged = false;
let configurationChangedOnRemoval = false;
// Remove the configurations of deleted folders
for (const key of this.cachedFolderConfigs.keys()) {
if (!this.workspace.roots.filter(folder => folder.toString() === key.toString())[0]) {
this.cachedFolderConfigs.delete(key);
if (this._configuration.deleteFolderConfiguration(key)) {
configurationChanged = true;
configurationChangedOnRemoval = true;
}
}
}
......@@ -554,8 +554,11 @@ export class WorkspaceServiceImpl extends WorkspaceService {
if (toInitialize.length) {
this.initCachesForFolders(toInitialize);
this.updateConfiguration(toInitialize)
.then(changed => configurationChanged || changed)
.then(changed => configurationChangedOnRemoval || changed)
.then(changed => changed ? this.triggerConfigurationChange() : void 0);
} else if (configurationChangedOnRemoval) {
this.updateWorkspaceConfiguration(false);
this.triggerConfigurationChange();
}
}
......@@ -823,8 +826,9 @@ export class Configuration<T> extends BaseConfiguration<T> {
updateBaseConfiguration(baseConfiguration: BaseConfiguration<T>): boolean {
const current = new Configuration(this._baseConfiguration, this._workspaceConfiguration, this.folders, this._workspace);
this._defaults = baseConfiguration.defaults;
this._user = baseConfiguration.user;
this._baseConfiguration = baseConfiguration;
this._defaults = this._baseConfiguration.defaults;
this._user = this._baseConfiguration.user;
this.merge();
return !this.equals(current);
......@@ -854,8 +858,10 @@ export class Configuration<T> extends BaseConfiguration<T> {
return false;
}
const changed = this.folders.get(folder).keys.length > 0;
this.folders.delete(folder);
return this._foldersConsolidatedConfigurations.delete(folder);
this._foldersConsolidatedConfigurations.delete(folder);
return changed;
}
getFolderConfigurationModel(folder: URI): FolderConfigurationModel<T> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册