livebook
livebook copied to clipboard
Provide go to definition of modules and functions defined in the notebook
When we show the docs, we can have a "go to definition" button. We can also support ctrl+click, as in Visual Studio.
Hi @josevalim can I pick up this issue?
Yes, please!
Hey! Are you still working on this, @hameedhub ? 🙂
I was curious and had a cursory look at this issue last night. From what I picked up, we already have systems in place for fetching modules/functions defined within a given notebook (as used by the autocompletion feature). That's great!
However, it seems that the information we require for go-to-definition wasn't available from the list of list(Runtime.completion_item())
s the Intellisense feature uses. I believe we'd need both 1) the id
of the cell that contains the given module/function (which is passed to data-p-cell-id
in the HTML), as well as 2) the line number within that cell. With these two pieces of information the frontend could then jump to a given cell at the appropriate location.
What would the high-level idea here be for implementation? Am I on the right track in terms of what data we need in the liveview? Would you see this as something that re-uses the functionality in Livebook.Intellisense
, or should this be something else entirely? I didn't yet read enough code to understand if we have easy ways for fetching the id
or the row number of a cell at all, so that's a bit of a mystery as well.
I believe @cristineguadelupe is looking into this as well. :)
Ah, great 🙂 Thanks for the heads-up!
I believe @cristineguadelupe is looking into this as well. :)
Yep! It's on my todo list
Closed in #2730 and #2741.