-
-
Notifications
You must be signed in to change notification settings - Fork 819
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
Basic Definition Finder for IDE #4309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on! It's really needed. Also, sorry for the long wait time. I left some comments now.
Co-authored-by: Laurenz <[email protected]>
Resolved all discussion other than the one to add a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored a little bit, but got some new questions in the process.
An aside: The node.find(some_expr.span())
is an interesting trick/workaround for the lack of a LinkedNode-style typed AST! ^^
dc0473e
to
f308b60
Compare
I have updated the PR according to the last conversation. |
Thank you! |
Co-authored-by: Laurenz <[email protected]>
This PR introduces a
typst_ide::definition
function. Its signature simulates that oftypst_ide::tooltip
. With given a cursor,typst_ide::definition
finds the definition of item at cursor:DefinitionKind::Module
: any module definitions with a span.DefinitionKind::Item
: any variables with a span or any builtin items (with a detached span).DefinitionKind::Label
: any<label>
definitions with a span.typst_ide::definition
doesn't find:Instead of completeness, we may focus on setting up workflow for
typst_ide::definition
.TestWorld
provides an only main source file.