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

Jump-to-definition for variables #304

Closed
fonsp opened this issue Aug 17, 2020 · 4 comments · Fixed by #1565
Closed

Jump-to-definition for variables #304

fonsp opened this issue Aug 17, 2020 · 4 comments · Fixed by #1565
Labels
frontend Concerning the HTML editor good first issue Good for newcomers help welcome If you are experienced in this topic - let us know!

Comments

@fonsp
Copy link
Owner

fonsp commented Aug 17, 2020

Easy to add in, because Pluto already has the list of which variables are defined where, but disproportionally difficult is:

  • Shadowed variables, i.e. the second x in f(x) = x does not refer to the global x.
  • Local variables (defined in the same cell).

Pluto understands both cases, but that information is not linked to a line number - it's accumulated at the cell level.

The same shortcut as VS Code: Ctrl+Click.

@fonsp
Copy link
Owner Author

fonsp commented Aug 17, 2020

Needs the same mechanism as #13. (It's only a "Good first issue" after that's done.)

@fonsp fonsp added frontend Concerning the HTML editor good first issue Good for newcomers help welcome If you are experienced in this topic - let us know! labels Aug 17, 2020
@fonsp
Copy link
Owner Author

fonsp commented Aug 17, 2020

@pfitzseb do you have any tips for making the string index available inside the AST? Does that question make sense?

Can we re-use something from the VS Code project?

@pfitzseb
Copy link

The question makes sense, but it's also why CSTParser exists: To get a syntax tree with column/line info available (and one that is round-trippable).

StaticLint.jl has everything you'd need here, I think, but I'm not 100% sure how easy it is to interface with. Juno also supports this just based on CSTParser (see the code here).

@fonsp
Copy link
Owner Author

fonsp commented Aug 18, 2020

Thanks for the Juno link - this looks similar to what I have written so far (ExpressionExplorer.jl), with metadata on top of just tracking Symbols. I will look into it more!

@fonsp fonsp linked a pull request Nov 3, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Concerning the HTML editor good first issue Good for newcomers help welcome If you are experienced in this topic - let us know!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants