mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 13:03:42 +01:00
Fix #85618
This commit is contained in:
@@ -11,6 +11,7 @@ import { FormattingOptions } from 'vs/base/common/jsonFormatter';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { ITextResourcePropertiesService, ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
class UserDataSyncUtilService implements IUserDataSyncUtilService {
|
||||
|
||||
@@ -21,8 +22,13 @@ class UserDataSyncUtilService implements IUserDataSyncUtilService {
|
||||
@ITextModelService private readonly textModelService: ITextModelService,
|
||||
@ITextResourcePropertiesService private readonly textResourcePropertiesService: ITextResourcePropertiesService,
|
||||
@ITextResourceConfigurationService private readonly textResourceConfigurationService: ITextResourceConfigurationService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
) { }
|
||||
|
||||
public async updateConfigurationValue(key: string, value: any): Promise<void> {
|
||||
await this.configurationService.updateValue(key, value, ConfigurationTarget.USER);
|
||||
}
|
||||
|
||||
public async resolveUserBindings(userBindings: string[]): Promise<IStringDictionary<string>> {
|
||||
const keys: IStringDictionary<string> = {};
|
||||
for (const userbinding of userBindings) {
|
||||
|
||||
@@ -61,6 +61,10 @@ export class SettingsSyncService extends Disposable implements ISettingsSyncServ
|
||||
this.channel.call('stop');
|
||||
}
|
||||
|
||||
resetLocal(): Promise<void> {
|
||||
return this.channel.call('resetLocal');
|
||||
}
|
||||
|
||||
hasPreviouslySynced(): Promise<boolean> {
|
||||
return this.channel.call('hasPreviouslySynced');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IUserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
|
||||
export class UserDataAutoSyncService extends Disposable implements IUserDataAutoSyncService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly channel: IChannel;
|
||||
|
||||
constructor(
|
||||
@ISharedProcessService sharedProcessService: ISharedProcessService
|
||||
) {
|
||||
super();
|
||||
this.channel = sharedProcessService.getChannel('userDataAutoSync');
|
||||
}
|
||||
|
||||
triggerAutoSync(): Promise<void> {
|
||||
return this.channel.call('triggerAutoSync');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
registerSingleton(IUserDataAutoSyncService, UserDataAutoSyncService);
|
||||
@@ -50,6 +50,14 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ
|
||||
return this.channel.call('sync', [_continue]);
|
||||
}
|
||||
|
||||
reset(): Promise<void> {
|
||||
return this.channel.call('reset');
|
||||
}
|
||||
|
||||
resetLocal(): Promise<void> {
|
||||
return this.channel.call('resetLocal');
|
||||
}
|
||||
|
||||
stop(): void {
|
||||
this.channel.call('stop');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user