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

Editor: Split "Lookup Symbol" and "Go to Definition" functionality #100692

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dalexeev
Copy link
Member

@dalexeev dalexeev commented Dec 21, 2024

I'm not sure which option is better from a user experience perspective, for now I've used the easiest to implement option (since Ctrl+LMB is hardcoded into CodeEdit):

  • Ctrl+LMB - Lookup Symbol (Open Documntation).
  • Ctrl+Shift+LMB - Go to Definition.

It would also be nice to merge #95821 first so that the behavior is deterministic. And optionally add a GitHub search for native symbols.

@AdriaandeJongh
Copy link
Contributor

I’m not a fan of this proposal simply because I use both of these functionalities a LOT when I code, and a) having to hold two modifiers when clicking is cumbersome, and b) having to think which of these I need to press.

@dalexeev
Copy link
Member Author

I’m not a fan of this proposal simply because I use both of these functionalities a LOT when I code

It's okay, it's just a draft, I'm happy to hear other opinions and find a better solution.

a) having to hold two modifiers when clicking is cumbersome

Another suggestions:

  • Ctrl+LMB and Alt+LMB;
  • Ctrl+LMB and Ctrl+RMB.

b) having to think which of these I need to press

I'm afraid that in the future you'll have to think about what you want to get. Previously, the same combination is used for opening the built-in help for native symbols and jumping to the source location for custom symbols. But we could also 1. open the documentation for custom symbols (this is especially useful for addons) and 2. search the source location on GitHub for native symbols.

As for modifiers, I think maybe we should change the order. Given that there are now tooltips for documentation, perhaps Ctrl+LMB should be used to jump to the definition, and the alternative combination (whichever we choose) should be used to open the documentation.

@TheRealSlander
Copy link

As for modifiers, I think maybe we should change the order. Given that there are now tooltips for documentation, perhaps Ctrl+LMB should be used to jump to the definition, and the alternative combination (whichever we choose) should be used to open the documentation.

Exactly what I think it would be the best to implement from now on. Tooltips remove the need to jump to the documentation.

@AdriaandeJongh
Copy link
Contributor

Thanks for sharing your considerations @dalexeev!

What about:

  • Ctrl + LMB goes to definition, unless native symbol; then it goes to documentation.
  • Alt + LMB goes to documentation.

Note that when we talk about Ctrl here, that it's actually Cmd here on macOS :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants