-
Notifications
You must be signed in to change notification settings - Fork 37.5k
Fixes #53372 #53503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed?
| } | ||
| } | ||
|
|
||
| export class OpenRawUserKeybindingsAction extends Action { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous comment, This is not needed.
| return this.getEditableSettingsURI(ConfigurationTarget.USER); | ||
| } | ||
|
|
||
| get userKeybindingsResource(): URI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
| return this.editorService.openEditor({ resource: this.defaultKeybindingsResource }); | ||
| } | ||
|
|
||
| openRawUserKeybindings(): TPromise<IEditor> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed
| switchSettings(target: ConfigurationTarget, resource: URI): TPromise<void>; | ||
| openGlobalKeybindingSettings(textual: boolean): TPromise<void>; | ||
| openRawDefaultKeybindings(): TPromise<IEditor>; | ||
| openRawUserKeybindings(): TPromise<IEditor>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed
| return otherInput instanceof KeybindingsEditorInput; | ||
| } | ||
|
|
||
| setDefaultSearchValue(defaultSearchValue = ''): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?