rust-lang / rust-lang/rust-analyzer
Setting `rust-analyzer.workspace.symbol.search.scope` to `workspace_and_dependencies` produces bad results
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
I am a VSCode user and I just learned about rust-analyzer.workspace.symbol.search.scope. Searching types from dependencies has been one of the features I really missed from IntelliJ.
Unfortunately, it appears that it is almost unusable in its current form. I am not sure what the sorting order is but it appears to be entirely random. I've also set rust-analyzer.workspace.symbol.search.scope to all_symbols and even when typing an exact symbol name from my local workspace, VSCode shows fuzzy-matched results from some my dependencies:
I think the results should be sorted by "distance" to the currently open file:
- Matches in the local workspace
- Matches in direct dependencies of the current crate
- Matches in direct dependencies of any workspace crate
- Matches in transitive dependencies
An MVP of the above could be to just prioritize workspace matches over dependency ones although I do think getting the order of results from dependencies right is also key.
A somewhat obvious one is also that full or at least partial matches should be prioritized over fuzzy-matched ones.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the implementation and results produced for rust-analyzer.workspace.symbol.search.scope in the VSCode integration. Reproduce searches with workspace_and_dependencies and all_symbols, then compare the observed ordering with the requested workspace, dependency-distance, and exact-match priorities; done means relevant local and exact or partial matches consistently rank ahead of less relevant fuzzy results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- developer-experience, devtools, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100