diff --git a/src/vs/platform/notification/common/notification.ts b/src/vs/platform/notification/common/notification.ts index 7b19313df6253a0896c767157452c0ed468d54f0..4a7adc958ac911316063f96625688a2a272a0a56 100644 --- a/src/vs/platform/notification/common/notification.ts +++ b/src/vs/platform/notification/common/notification.ts @@ -65,7 +65,7 @@ export interface INeverShowAgainOptions { /** * Whether to persist the choice in the current workspace or for all workspaces. By - * default it will be persisted for all workspaces. + * default it will be persisted for all workspaces (= `NeverShowAgainScope.GLOBAL`). */ readonly scope?: NeverShowAgainScope; } diff --git a/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.ts b/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.ts index 2febc613bf7bd1b95db621935b706cfca0ba8ef6..8268057aff8eaabf5dac36e2b48d8e3b5e724447 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.ts @@ -11,6 +11,7 @@ import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; +import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys'; /** * Shows a message when opening a large file which has been memory optimized (and features disabled). @@ -23,9 +24,13 @@ export class LargeFileOptimizationsWarner extends Disposable implements IEditorC private readonly _editor: ICodeEditor, @INotificationService private readonly _notificationService: INotificationService, @IConfigurationService private readonly _configurationService: IConfigurationService, + @IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService ) { super(); + // opt-in to syncing + const neverShowAgainId = 'editor.contrib.largeFileOptimizationsWarner'; + storageKeysSyncRegistryService.registerStorageKey({ key: neverShowAgainId, version: 1 }); this._register(this._editor.onDidChangeModel((e) => { const model = this._editor.getModel(); @@ -56,7 +61,7 @@ export class LargeFileOptimizationsWarner extends Disposable implements IEditorC }); } } - ], { neverShowAgain: { id: 'editor.contrib.largeFileOptimizationsWarner' } }); + ], { neverShowAgain: { id: neverShowAgainId } }); } })); } diff --git a/src/vs/workbench/contrib/codeEditor/browser/semanticTokensHelp.ts b/src/vs/workbench/contrib/codeEditor/browser/semanticTokensHelp.ts index fa8f8d5c8d8fd3b44d759f12cd6497f1028d78ff..2b7a2d617e4ee304c8932cac302394b4c565ceae 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/semanticTokensHelp.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/semanticTokensHelp.ts @@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri'; import { ITextModel } from 'vs/editor/common/model'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys'; /** * Shows a message when semantic tokens are shown the first time. @@ -30,10 +31,15 @@ export class SemanticTokensHelp extends Disposable implements IEditorContributio @INotificationService _notificationService: INotificationService, @IOpenerService _openerService: IOpenerService, @IWorkbenchThemeService _themeService: IWorkbenchThemeService, - @IEditorService _editorService: IEditorService + @IEditorService _editorService: IEditorService, + @IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService ) { super(); + // opt-in to syncing + const neverShowAgainId = 'editor.contrib.semanticTokensHelp'; + storageKeysSyncRegistryService.registerStorageKey({ key: neverShowAgainId, version: 1 }); + const toDispose = this._register(new DisposableStore()); const localToDispose = toDispose.add(new DisposableStore()); const installChangeTokenListener = (model: ITextModel) => { @@ -75,7 +81,7 @@ export class SemanticTokensHelp extends Disposable implements IEditorContributio _openerService.open(URI.parse(url)); } } - ], { neverShowAgain: { id: 'editor.contrib.semanticTokensHelp' } }); + ], { neverShowAgain: { id: neverShowAgainId } }); })); }; diff --git a/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts b/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts index a80b158816b7cf934b553d0b15a8713fe3d03f2b..6a2baff6544d9926b6349587e2e3938e1f4d039f 100644 --- a/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts +++ b/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts @@ -241,9 +241,13 @@ class ResolveSaveConflictAction extends Action { @IEditorService private readonly editorService: IEditorService, @INotificationService private readonly notificationService: INotificationService, @IInstantiationService private readonly instantiationService: IInstantiationService, - @IProductService private readonly productService: IProductService + @IProductService private readonly productService: IProductService, + @IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService ) { super('workbench.files.action.resolveConflict', nls.localize('compareChanges', "Compare")); + + // opt-in to syncing + storageKeysSyncRegistryService.registerStorageKey({ key: LEARN_MORE_DIRTY_WRITE_IGNORE_KEY, version: 1 }); } async run(): Promise { diff --git a/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts b/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts index 72196fa380c8b0731752c62b0aa2551d7ff289ff..5fa43acd8173713110a05d7e705891d8dcf4f0b9 100644 --- a/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts +++ b/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts @@ -50,6 +50,7 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo super(); storageKeysSyncRegistryService.registerStorageKey({ key: LANGUAGEPACK_SUGGESTION_IGNORE_STORAGE_KEY, version: 1 }); + storageKeysSyncRegistryService.registerStorageKey({ key: 'langugage.update.donotask', version: 1 }); this.checkAndInstall(); this._register(this.extensionManagementService.onDidInstallExtension(e => this.onDidInstallExtension(e))); } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts index d182592bf01c85b3f456d41222148d99d0a84fb9..9c9014f7c26def1e5a0db44078983b5a8b7625f3 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts @@ -21,6 +21,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { InstallRecommendedExtensionAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { IProductService } from 'vs/platform/product/common/productService'; import { XTermCore } from 'vs/workbench/contrib/terminal/browser/xterm-private'; +import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys'; const MINIMUM_FONT_SIZE = 6; const MAXIMUM_FONT_SIZE = 25; @@ -47,7 +48,8 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper { @IStorageService private readonly _storageService: IStorageService, @ITelemetryService private readonly telemetryService: ITelemetryService, @IInstantiationService private readonly instantiationService: IInstantiationService, - @IProductService private readonly productService: IProductService + @IProductService private readonly productService: IProductService, + @IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService ) { this._updateConfig(); this._configurationService.onDidChangeConfiguration(e => { @@ -55,6 +57,9 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper { this._updateConfig(); } }); + + // opt-in to syncing + storageKeysSyncRegistryService.registerStorageKey({ key: 'terminalConfigHelper/launchRecommendationsIgnore', version: 1 }); } private _updateConfig(): void { diff --git a/src/vs/workbench/contrib/update/browser/update.ts b/src/vs/workbench/contrib/update/browser/update.ts index 0e39da8602fd481cb2558bf4aef4002b78cb0d42..2e7fe01da59dea46b758bc64f33f6364feda8492 100644 --- a/src/vs/workbench/contrib/update/browser/update.ts +++ b/src/vs/workbench/contrib/update/browser/update.ts @@ -29,6 +29,7 @@ import { ShowCurrentReleaseNotesActionId, CheckForVSCodeUpdateActionId } from 'v import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IProductService } from 'vs/platform/product/common/productService'; import product from 'vs/platform/product/common/product'; +import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys'; export const CONTEXT_UPDATE_STATE = new RawContextKey('updateState', StateType.Idle); @@ -179,12 +180,16 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu @IActivityService private readonly activityService: IActivityService, @IContextKeyService private readonly contextKeyService: IContextKeyService, @IProductService private readonly productService: IProductService, - @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService + @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService, + @IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService ) { super(); this.state = updateService.state; this.updateStateContextKey = CONTEXT_UPDATE_STATE.bindTo(this.contextKeyService); + // opt-in to syncing + storageKeysSyncRegistryService.registerStorageKey({ key: 'neverShowAgain:update/win32-fast-updates', version: 1 }); + this._register(updateService.onStateChange(this.onUpdateStateChange, this)); this.onUpdateStateChange(this.updateService.state); diff --git a/src/vs/workbench/services/notification/common/notificationService.ts b/src/vs/workbench/services/notification/common/notificationService.ts index 066ad9acd03c5fae154264f7d9a52bf24f141a56..9d86d1af26558393e028b452e0037511bb200297 100644 --- a/src/vs/workbench/services/notification/common/notificationService.ts +++ b/src/vs/workbench/services/notification/common/notificationService.ts @@ -11,7 +11,6 @@ import { Event } from 'vs/base/common/event'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IAction, Action } from 'vs/base/common/actions'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys'; export class NotificationService extends Disposable implements INotificationService { @@ -21,8 +20,7 @@ export class NotificationService extends Disposable implements INotificationServ get model(): INotificationsModel { return this._model; } constructor( - @IStorageService private readonly storageService: IStorageService, - @IStorageKeysSyncRegistryService private readonly storageKeysSyncRegistryService: IStorageKeysSyncRegistryService + @IStorageService private readonly storageService: IStorageService ) { super(); } @@ -70,11 +68,6 @@ export class NotificationService extends Disposable implements INotificationServ const scope = notification.neverShowAgain.scope === NeverShowAgainScope.WORKSPACE ? StorageScope.WORKSPACE : StorageScope.GLOBAL; const id = notification.neverShowAgain.id; - // opt-in to syncing if global - if (scope === StorageScope.GLOBAL) { - this.storageKeysSyncRegistryService.registerStorageKey({ key: id, version: 1 }); - } - // If the user already picked to not show the notification // again, we return with a no-op notification here if (this.storageService.getBoolean(id, scope)) { @@ -126,11 +119,6 @@ export class NotificationService extends Disposable implements INotificationServ const scope = options.neverShowAgain.scope === NeverShowAgainScope.WORKSPACE ? StorageScope.WORKSPACE : StorageScope.GLOBAL; const id = options.neverShowAgain.id; - // opt-in to syncing if global - if (scope === StorageScope.GLOBAL) { - this.storageKeysSyncRegistryService.registerStorageKey({ key: id, version: 1 }); - } - // If the user already picked to not show the notification // again, we return with a no-op notification here if (this.storageService.getBoolean(id, scope)) {