This commit is contained in:
Sandeep Somavarapu 2022-07-25 21:01:27 +02:00 committed by GitHub
parent 89b035aa3d
commit d98ae61984
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -717,7 +717,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
if (e.preserveData) {
await Promise.all([
this.copyProfileSettings(e.previous.settingsResource, e.profile.settingsResource),
this.fileService.copy(e.previous.tasksResource, e.profile.tasksResource)
this.copyProfileTasks(e.previous.tasksResource, e.profile.tasksResource)
]);
}
const promises: Promise<ConfigurationModel>[] = [];
@ -751,6 +751,12 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
await this.fileService.writeFile(to, VSBuffer.fromString(toContent));
}
private async copyProfileTasks(from: URI, to: URI): Promise<void> {
if (await this.fileService.exists(from)) {
await this.fileService.copy(from, to);
}
}
private onDefaultConfigurationChanged(configurationModel: ConfigurationModel, properties?: string[]): void {
if (this.workspace) {
const previousData = this._configuration.toData();

View file

@ -743,7 +743,9 @@ class UserKeybindings extends Disposable {
private async whenCurrentProfieChanged(e: DidChangeUserDataProfileEvent): Promise<void> {
if (e.preserveData) {
await this.fileService.copy(e.previous.keybindingsResource, e.profile.keybindingsResource);
if (await this.fileService.exists(e.previous.keybindingsResource)) {
await this.fileService.copy(e.previous.keybindingsResource, e.profile.keybindingsResource);
}
}
this.watch();
this.reloadConfigurationScheduler.schedule();