feat: go-to definition#9619
Merged
Merged
Conversation
|
Contributor
|
WOW! It's so cool! |
ematipico
added a commit
that referenced
this pull request
Apr 24, 2026
ematipico
added a commit
that referenced
this pull request
May 1, 2026
ematipico
added a commit
that referenced
this pull request
May 8, 2026
ematipico
added a commit
that referenced
this pull request
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #9618
This PR sets the foundations of go-to definition and implements part of the logic.
How it works
I added a new
editorcapability to the list. This new type now contains two functions, which are essentially two side of the same coin:DefinitionReferencethat says: the reference is here (checked against the semantic model), the reference has been imported (via JS import for now, but it's been left generic), or the reference is a CSS string.The module graph has been modified. We now store the content offset of the CSS snippets found in the HTML document. This information is needed so that, when we resolve the style definition, we can compute the correct offset.
Note
I used a coding agent to help me with tests, refactor of testing infra, updates things across tests. The majority of the architecture was designed by me.
Test Plan
Added plenty of tests.
Manually tested with Zed. It works like a charm for the things we're implementing.
Happy to share a recording if you want.
CI won't run, but I checked that
just landjust fwork. And all tests pass.I refactored the tests of server.tests.ts because it was becoming a 2k lines of tests. I moved all the navigation tests into its own file, and added a new file to share the common utilities
Docs