提交 24eb4d16 编写于 作者: S Sandeep Somavarapu

a setting to enable/disable extensions sync

上级 7535d832
......@@ -18,6 +18,7 @@ import { keys, values } from 'vs/base/common/map';
import { startsWith } from 'vs/base/common/strings';
import { IFileService } from 'vs/platform/files/common/files';
import { Queue } from 'vs/base/common/async';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export interface ISyncPreviewResult {
readonly added: ISyncExtension[];
......@@ -48,6 +49,7 @@ export class ExtensionsSynchroniser extends Disposable implements ISynchroniser
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
@ILogService private readonly logService: ILogService,
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService,
@IConfigurationService private readonly configurationService: IConfigurationService,
) {
super();
this.replaceQueue = this._register(new Queue());
......@@ -68,6 +70,10 @@ export class ExtensionsSynchroniser extends Disposable implements ISynchroniser
}
async sync(): Promise<boolean> {
const syncExtensions = this.configurationService.getValue<boolean>('userConfiguration.syncExtensions');
if (syncExtensions === undefined || syncExtensions === false) {
return false;
}
if (this.status !== SyncStatus.Idle) {
return false;
......
......@@ -42,6 +42,12 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
description: localize('userConfiguration.enableSync', "When enabled, synchronises User Configuration: Settings, Keybindings, Extensions & Snippets."),
default: true,
scope: ConfigurationScope.APPLICATION
},
'userConfiguration.syncExtensions': {
type: 'boolean',
description: localize('userConfiguration.syncExtensions', "When enabled extensions are synchronised while synchronising user configuration."),
default: true,
scope: ConfigurationScope.APPLICATION
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册