fix(langserver): support go-to-definition for plugin-defined rules#3491
Open
njskalski wants to merge 2 commits intothought-machine:masterfrom
Open
fix(langserver): support go-to-definition for plugin-defined rules#3491njskalski wants to merge 2 commits intothought-machine:masterfrom
njskalski wants to merge 2 commits intothought-machine:masterfrom
Conversation
added 2 commits
February 27, 2026 15:43
Previously, go-to-definition only worked for core builtin functions. Plugin-defined rules like go_library, go_repo, etc. would return no results because they were parsed by a different parser instance than the one used by the language server. Changes: - Use parse.InitParser() to initialize the parser on BuildState, then get the same parser via parse.GetAspParser() for the language server - Add periodic loading of function definitions (every 2 seconds) so go-to-definition works progressively while the full parse runs - Add Range() method to cmap types to iterate over parsed ASTs - Add AllFunctionsByFile() to asp.Parser to retrieve function definitions - Fix file URIs to use absolute paths
Contributor
Author
|
@jwong-beep can I ask you for re-review? |
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.
This is a follow up MR from #3485 . As suggested by @toastwaffle I split the MR into two smaller pieces. This one is about go-to-definition in plugin rules.
I applied every single requested change. Furthermore, I removed all formatting changes my IDE did, to keep the patch short.