Implement goto-definition for local symbols#1230
Open
lionel- wants to merge 7 commits into
Open
Conversation
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.
Part of posit-dev/positron#13749
Part of #1149
Closes posit-dev/positron#8631 (should extract NSE bullet in its own issue, also affecting find-refs and rename).
Adds precise within-file goto-definition driven by Oak's semantic index.
The Salsa rewrite is taking more time and merging right before release seems a bit risky, given the added complexity. So it looks like full cross-file support for goto-def, find-refs, and rename is not going to make it to the June release. However we already have everything we need for within-file analysis.
This PR adds support for jumping to definition of locally-defined symbols (
def <-and function parameters):Removes the
ARK_OAK_GOTO_DEF-gated goto-definition handler, and all its non-Salsa baggage. That's a regression in our dev builds (we can no longer exercise the oak_sources stuff to visit installed package definitions), but that will be restored later this week with the proper Salsa implementation.Adds within-file support in Ark's goto-definition handler, based on Oak's semantic index. If the symbol is not bound in the file, we use the legacy indexer-based handler. This legacy handler includes all symbols of the same name in other files, including unrelated files. This will be fixed once we fully switch to Oak.
Note that for conditionally unbound (via e.g.
if (cond) x <- 1), we don't use the legacy handlers to populate external symbols, because the complexity wasn't worth the slight and temporary inconsistency.