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

Provide go to definition of modules and functions defined in the notebook #1546

Open
josevalim opened this issue Nov 23, 2022 · 6 comments
Open
Labels
area:frontend Related to UI/UX contributions welcome Ready to implement (contributions welcome) feature New feature or request

Comments

@josevalim
Copy link
Contributor

When we show the docs, we can have a "go to definition" button. We can also support ctrl+click, as in Visual Studio.

@josevalim josevalim added feature New feature or request area:frontend Related to UI/UX labels Nov 23, 2022
@josevalim josevalim added the contributions welcome Ready to implement (contributions welcome) label Jul 19, 2023
@hameedhub
Copy link
Contributor

Hi @josevalim can I pick up this issue?

@josevalim
Copy link
Contributor Author

Yes, please!

@juhalehtonen
Copy link
Contributor

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.

@josevalim
Copy link
Contributor Author

I believe @cristineguadelupe is looking into this as well. :)

@juhalehtonen
Copy link
Contributor

Ah, great 🙂 Thanks for the heads-up!

@cristineguadelupe cristineguadelupe self-assigned this Feb 16, 2024
@cristineguadelupe
Copy link
Contributor

I believe @cristineguadelupe is looking into this as well. :)

Yep! It's on my todo list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:frontend Related to UI/UX contributions welcome Ready to implement (contributions welcome) feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants