Skip to content
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

Address VSCode issue 45679 #45995

Closed
wants to merge 1 commit into from
Closed

Address VSCode issue 45679 #45995

wants to merge 1 commit into from

Conversation

joerohde
Copy link

#45679

  • Accept mac/linux/win overrides in user keybindings
  • Behave same as extension contributed keys
  • Add tests

 - Accept mac/linux/win overrides in user keybindings
 - Behave same as extension contributed keys
 - Add tests
@msftclas
Copy link

msftclas commented Mar 16, 2018

CLA assistant check
All CLA requirements met.

@alexdima
Copy link
Member

alexdima commented Mar 26, 2018

Although this is a working solution to the problem of synchronizing keybindings.json across OSes, my concern is that this change complicates things for the vast number of people that don't need to synchronize keybindings.json via cp across machines with different OSes. i.e. everybody will now be exposed via schema suggestions to win, mac, linux.

Two possible design alternatives:

  • have platform specific files: e.g. keybindings.win.json, keybindings.mac.json that would overwrite a cross-OS shareable keybindings.json. This might be also be equally difficult for regular folks to work with.
  • have os available as a when context key. e.g.
{ "key": "ctrl+f", "command": "editor.action.commentLine", "when": "os==='win'" }

opinions @Microsoft/vscode ?

@bpasero
Copy link
Member

bpasero commented Mar 26, 2018

@alexandrudima I actually fine the OS when condition a elegant solution.

@joerohde
Copy link
Author

joerohde commented Mar 26, 2018

OK. I'll throw a couple thoughts - I do see your point.

  • The 'Keyboard Shortcuts' (unlike settings) does not open the json when used. I think the user base that is going to muck with the json and edit it to where they see the autocomplete can also read the descriptive text (which I certainly could have done better with like saying 'optional' and 'override'). admittedly - I don't interact with the general user base day to day. :)

  • With a json array entry per override with a 'where' it is likely to get cumbersome over time and make it very hard to get a holistic look at what keys are bound to a command). I don't think it makes sense to list the overrides in the Keyboard Shortcuts page, as I do agree - most users won't care.

  • I was hoping to do PLs for the various sync extensions to allow a merging command and config for using a shared keybinding file (as they do bullet 1 above behind the scenes). While not a real consideration for what's the right design, the 'merge' would be awkward at best with a 'when' solution. Doing the OS specific config files would break the sync extensions until they update.

  • This model is already used in the settings (terminal and shell), and launch config. Albeit primarily as 'osx' for the mac.

@bpasero
Copy link
Member

bpasero commented Aug 7, 2018

Duplicate of #54894

@bpasero bpasero marked this as a duplicate of #54894 Aug 7, 2018
@alexdima
Copy link
Member

alexdima commented Aug 7, 2018

PR #54894 adds the context keys that we need.

@alexdima alexdima closed this Aug 7, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants