livebook-dev / livebook

Automate code & data workflows with interactive Elixir notebooks
https://livebook.dev
Apache License 2.0
4.92k stars 422 forks source link

UX improvement: change mouse cursor for go to definition #2823

Closed hugobarauna closed 1 week ago

hugobarauna commented 1 week ago

Regarding the "go to definition" feature, it would be nice if we changed the mouse cursor to give a hint the definition is clickable, similar to how VS Code works:

https://share.cleanshot.com/T61XW8F9

The idea is that when hovering over a module or function that has a definition inside the notebook, when the user presses/holds Command ⌘ (for macOS) or Ctrl (for Windows/Linux), the mouse cursor changes to "cursor".

If the user stops pressing/holding Command ⌘ (for macOS) or Ctrl (for Windows/Linux), the cursor will return to its previous value ("text").

josevalim commented 1 week ago

This is hard to do in the client because the parsing of Elixir code and understanding of when there is a definition happens in the server, so there is always a delay. We could try to make it work for some cases by pushing logic to the client, but probably not worth it.

jonatanklosko commented 1 week ago

Technically we have access to AST on the client, but there would be a lot of false positives, because we only jump if the module is defined in the notebook, and for other modules we don't know that upfront. So giving user the impression that the function is clickable, but then nothing happens, may be confusing.

hugobarauna commented 1 week ago

@jonatanklosko I see, thanks.

So, closing this issue.