Requires #1141 and #1148. Augmented by #1146.
No need for Salsa here, we can just recompute on the fly for the time being.
Main user-visible behaviour change to discuss: Symbols are resolved from the scope. Currently we just piggyback on the workspace indexer for all files without any scope consideration. For scripts in particular, this means symbols will be isolated, unless you're explicit about the provenance, e.g. by calling source(). We'd also allow declarations like declare(source("foo.R")) in case the side effect of sourcing is not desirable for some reason.
Requires #1141 and #1148. Augmented by #1146.
Goto definition: The semantic index provides file-local targets (Implement the semantic index #1141). For unbound symbols, we resort to cross-file resolution (Cross-file symbol resolution #1148). These could land in a project file, in which case we provide that file's definition. Or these could be symbols from installed packages.
In the latter case we can use either virtual files created from srcrefs, downloaded sources (Ark: Download package source code from CRAN tarballs positron#2286), or our current namespace deparser fallback we use for the debugger (though we're considering removing it in favour of the new fallbacks just mentioned). See Add
PackageCachefor populating a package source cache #1146. This will be a big UX improvement for advanced users. It allows jumping to any function's source in context, with comments and roxygen documentation available.Done in Implement goto-definition with Oak #1153
Find references: ty and rust-analyzer both do a textual search across files, then resolve symbols to see if they match the definition for the symbol at cursor.
Rename: Easy once we have the other two handlers. Find definitions and references, then rename.
No need for Salsa here, we can just recompute on the fly for the time being.
Main user-visible behaviour change to discuss: Symbols are resolved from the scope. Currently we just piggyback on the workspace indexer for all files without any scope consideration. For scripts in particular, this means symbols will be isolated, unless you're explicit about the provenance, e.g. by calling
source(). We'd also allow declarations likedeclare(source("foo.R"))in case the side effect of sourcing is not desirable for some reason.