Add shortcut for Lookup Symbol action
Closes #86773
- Allows keyboard navigation by symbol lookups.
- Performs the same functionality as CTRL + Click on a symbol.
This shortcut is essential for users who desire mouseless navigation in the code editor.
I think this line
context_menu->add_item(TTR("Lookup Symbol"), LOOKUP_SYMBOL);
Should be changed for:
context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_symbol"), LOOKUP_SYMBOL);
That way, the context menu will have the right name and shortcut.
Currently with this PR:
That will rename the option "Lookup symbol" for "Go to symbol" in the context menu which is probably better and more standard with the other items in the "Go to" menu in my opinion.
Also, I'm not sure about Ctrl-Alt-Enter as the default shortcut. That shortcut is used by VMWare and Remote Desktop to send Ctrl-Alt-Del to the remote machine. I did not personally seen this shortcut be used in an editor? The default in VSCode and Visual Studio. In IntelliJ and Rider, it's Ctrl-B I think, maybe Ctrl-B ?
Approved in principle but a bit too fast - @Hilderin's feedback above is good and should be taken into account before merge.
Also, I'm not sure about
Ctrl-Alt-Enteras the default shortcut. That shortcut is used by VMWare and Remote Desktop to sendCtrl-Alt-Delto the remote machine. I did not personally seen this shortcut be used in an editor? The default in VSCode and Visual Studio. In IntelliJ and Rider, it'sCtrl-BI think, maybeCtrl-B?
I agree Ctrl+Alt+Enter seems unconventional. I don't think we can use Ctrl+B though, AFAIK it's used for going to the next bookmark: https://docs.godotengine.org/en/stable/tutorials/editor/default_key_mapping.html (And on macOS for running the project, which may clash with the bookmark one already?)
In VSCode, at least, Go To Definition (which i believe is the closest thing to the "Lookup Symbol" feature) is bound to F12 by default.
Besides, i think it will be better not to block this feature on some bikeshedding around the default shortcut. If there's no clear "winner", let the shortcut be unbound by default until a consensus is reached.
@laspencer91 This feature seems needed by a lot of users. Do you think you could rebase and make the adjustment suggested? If not, it will be my pleasure to finish it.
Superseded by https://github.com/godotengine/godot/pull/101565. Thanks for the contribution!