提交 222b508d 编写于 作者: R Rob Lourens

Register settings editor prompt key to sync #93332

上级 7939ea72
...@@ -47,6 +47,7 @@ import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEdit ...@@ -47,6 +47,7 @@ import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEdit
import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput'; import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput';
import { Settings2EditorModel } from 'vs/workbench/services/preferences/common/preferencesModels'; import { Settings2EditorModel } from 'vs/workbench/services/preferences/common/preferencesModels';
import { IEditorModel } from 'vs/platform/editor/common/editor'; import { IEditorModel } from 'vs/platform/editor/common/editor';
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
function createGroupIterator(group: SettingsTreeGroupElement): Iterator<ITreeElement<SettingsTreeGroupChild>> { function createGroupIterator(group: SettingsTreeGroupElement): Iterator<ITreeElement<SettingsTreeGroupChild>> {
const groupsIt = Iterator.fromArray(group.children); const groupsIt = Iterator.fromArray(group.children);
...@@ -67,6 +68,7 @@ interface IFocusEventFromScroll extends KeyboardEvent { ...@@ -67,6 +68,7 @@ interface IFocusEventFromScroll extends KeyboardEvent {
fromScroll: true; fromScroll: true;
} }
const SETTINGS_AUTOSAVE_NOTIFIED_KEY = 'hasNotifiedOfSettingsAutosave';
const SETTINGS_EDITOR_STATE_KEY = 'settingsEditorState'; const SETTINGS_EDITOR_STATE_KEY = 'settingsEditorState';
export class SettingsEditor2 extends BaseEditor { export class SettingsEditor2 extends BaseEditor {
...@@ -157,7 +159,8 @@ export class SettingsEditor2 extends BaseEditor { ...@@ -157,7 +159,8 @@ export class SettingsEditor2 extends BaseEditor {
@IStorageService private readonly storageService: IStorageService, @IStorageService private readonly storageService: IStorageService,
@INotificationService private readonly notificationService: INotificationService, @INotificationService private readonly notificationService: INotificationService,
@IEditorGroupsService protected editorGroupService: IEditorGroupsService, @IEditorGroupsService protected editorGroupService: IEditorGroupsService,
@IKeybindingService private readonly keybindingService: IKeybindingService @IKeybindingService private readonly keybindingService: IKeybindingService,
@IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService,
) { ) {
super(SettingsEditor2.ID, telemetryService, themeService, storageService); super(SettingsEditor2.ID, telemetryService, themeService, storageService);
this.delayedFilterLogging = new Delayer<void>(1000); this.delayedFilterLogging = new Delayer<void>(1000);
...@@ -183,6 +186,8 @@ export class SettingsEditor2 extends BaseEditor { ...@@ -183,6 +186,8 @@ export class SettingsEditor2 extends BaseEditor {
this.onConfigUpdate(e.affectedKeys); this.onConfigUpdate(e.affectedKeys);
} }
})); }));
storageKeysSyncRegistryService.registerStorageKey({ key: SETTINGS_AUTOSAVE_NOTIFIED_KEY, version: 1 });
} }
get minimumWidth(): number { return 375; } get minimumWidth(): number { return 375; }
...@@ -704,8 +709,8 @@ export class SettingsEditor2 extends BaseEditor { ...@@ -704,8 +709,8 @@ export class SettingsEditor2 extends BaseEditor {
} }
private notifyNoSaveNeeded() { private notifyNoSaveNeeded() {
if (!this.storageService.getBoolean('hasNotifiedOfSettingsAutosave', StorageScope.GLOBAL, false)) { if (!this.storageService.getBoolean(SETTINGS_AUTOSAVE_NOTIFIED_KEY, StorageScope.GLOBAL, false)) {
this.storageService.store('hasNotifiedOfSettingsAutosave', true, StorageScope.GLOBAL); this.storageService.store(SETTINGS_AUTOSAVE_NOTIFIED_KEY, true, StorageScope.GLOBAL);
this.notificationService.info(localize('settingsNoSaveNeeded', "Your changes are automatically saved as you edit.")); this.notificationService.info(localize('settingsNoSaveNeeded', "Your changes are automatically saved as you edit."));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册