Fixes #53372 #53503
Conversation
Added workbench.settings.openDefaultKeybindings setting
|
@sandy081 Done! Review please. |
|
Just putting a reminder here as there haven't been any activity for a while now. @sandy081 |
| } | ||
|
|
||
| setInput(input: KeybindingsEditorInput, options: EditorOptions, token: CancellationToken): Thenable<void> { | ||
| this.searchWidget.setValue(input.defaultSearchValue); |
| } | ||
| } | ||
|
|
||
| export class OpenRawUserKeybindingsAction extends Action { |
There was a problem hiding this comment.
We already have an action to open keybindings json file - OpenGlobalKeybindingsFileAction. So we do not need this action.
| "textual" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } | ||
| } | ||
| */ | ||
| const openDefaultKeybindings = !!this.configurationService.getValue('workbench.settings.openDefaultKeybindings'); |
There was a problem hiding this comment.
Move this line to inside if(textual) block
| } | ||
| return this.editorService.openEditor(this.instantiationService.createInstance(KeybindingsEditorInput), { pinned: true }).then(() => null); | ||
|
|
||
| const keybindingsEditorInput = this.instantiationService.createInstance(KeybindingsEditorInput); |
There was a problem hiding this comment.
I do not think openDefaultKeybindings setting should interfere in Keybindings editor. This setting should decide to open or not the default keybindings file when you open keybindings as a file instead of editor.
| registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalSettingsAction, OpenGlobalSettingsAction.ID, OpenGlobalSettingsAction.LABEL), 'Preferences: Open User Settings', category); | ||
| registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalKeybindingsAction, OpenGlobalKeybindingsAction.ID, OpenGlobalKeybindingsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_S) }), 'Preferences: Open Keyboard Shortcuts', category); | ||
| registry.registerWorkbenchAction(new SyncActionDescriptor(OpenRawDefaultKeybindingsAction, OpenRawDefaultKeybindingsAction.ID, OpenRawDefaultKeybindingsAction.LABEL), 'Preferences: Open Raw Default Settings', category); | ||
| registry.registerWorkbenchAction(new SyncActionDescriptor(OpenRawUserKeybindingsAction, OpenRawUserKeybindingsAction.ID, OpenRawUserKeybindingsAction.LABEL), 'Preferences: Open Raw Default Settings', category); |
There was a problem hiding this comment.
Same as previous comment, This is not needed.
| return this.getEditableSettingsURI(ConfigurationTarget.USER); | ||
| } | ||
|
|
||
| get userKeybindingsResource(): URI { |
| return this.editorService.openEditor({ resource: this.defaultKeybindingsResource }); | ||
| } | ||
|
|
||
| openRawUserKeybindings(): TPromise<IEditor> { |
| switchSettings(target: ConfigurationTarget, resource: URI): TPromise<void>; | ||
| openGlobalKeybindingSettings(textual: boolean): TPromise<void>; | ||
| openRawDefaultKeybindings(): TPromise<IEditor>; | ||
| openRawUserKeybindings(): TPromise<IEditor>; |
| return otherInput instanceof KeybindingsEditorInput; | ||
| } | ||
|
|
||
| setDefaultSearchValue(defaultSearchValue = ''): void { |
Reverted changes regareding kebindingsEditor and removed some actions.
|
I have pushed requested changes. Review please, @sandy081 |
| registry.registerWorkbenchAction(new SyncActionDescriptor(OpenSettings2Action, OpenSettings2Action.ID, OpenSettings2Action.LABEL), 'Preferences: Open Settings (Preview)', category); | ||
| registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalSettingsAction, OpenGlobalSettingsAction.ID, OpenGlobalSettingsAction.LABEL), 'Preferences: Open User Settings', category); | ||
| registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalKeybindingsAction, OpenGlobalKeybindingsAction.ID, OpenGlobalKeybindingsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_S) }), 'Preferences: Open Keyboard Shortcuts', category); | ||
| registry.registerWorkbenchAction(new SyncActionDescriptor(OpenRawDefaultKeybindingsAction, OpenRawDefaultKeybindingsAction.ID, OpenRawDefaultKeybindingsAction.LABEL), 'Preferences: Open Raw Default Settings', category); |
There was a problem hiding this comment.
Label should be Preferences: Open Default Keyboard Shortcuts File
|
@njkevlani LGTM. Thanks for the PR |
|
Thanks for accepting!! @sandy081 |
Fixes #53372
What is done?
Added following Actions:
Added following Settings:
What is remaining?
When keybindings are opened with
keyindingsEditor, it shows User+Default keybindings regardless of whatopenDefaultKeybindingsis set to(works forjsonfile, though). I wanted to use already implementedfetchfunction, with@source:user, for this functionality. But I got some errors. Can you suggest how should I approach this @sandy081?