-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Update menu when reassigning keybindings or installing keybinding extension #14625
Comments
Yes, that has always been like that but I think we can fix it easily. |
@bpasero May I work on this? I'm a first time contributor to vscode. |
Sure, feel free. |
@bpasero Could you please help me out with these questions? Thank you!
|
Let me forward the debug questions to our debug team: @roblourens @weinand @isidorn are we able to debug the Electron main side these days? @arthur801031 I suggest to check how keybindings are resolved today right on startup (https://github.com/Microsoft/vscode/blob/master/src/vs/code/electron-main/menus.ts#L180) and then add a listener for keybindings.json changes to run a similar call to update the menu. |
It seems that Electron does not support updating menus dynamically: https://github.com/Microsoft/vscode/blob/master/src/vs/code/electron-main/menus.ts#L197 |
That is true. On startup we read the keybindings from a cached location on disk, then we start a window and ask that window to resolve all keybindings. If the keybindings differ, we update the menu once again. Ugly, but the only way possible atm. |
@arthur801031 yes, this issue is about updating the menu without the need for restart. |
Hi @bpasero, I'm trying to create a listener for keybindings.json, but I can't get the keybindings.json file path right. Here is my code in the registerListeners function of /vscode/out/vs/code/electron-main/menus.js: Another question that I have is if I place these code inside src/vs/code/electron-main/menus.ts that piece of code wouldn't run, which means the error message wouldn't even show up. Please help. Thank you so much! |
Also applies to when installing a keymap extension (/cc @chrmarti). happy to review a PR on this one, I think what is needed is to:
|
Below, Ctrl+S has been reassigned to
workbench.action.relaodWindow
, andCtrl+I
has been assigned toworkbench.action.files.save
, but he File context menu has not been updated appropriately.The text was updated successfully, but these errors were encountered: