Skip to content

Setting rust-analyzer.workspace.symbol.search.scope to workspace_and_dependencies produces bad results #16491

@thomaseizinger

Description

@thomaseizinger

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:

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-vscodevscode plugin issuesS-blockedStatus: marked as blocked ❌ on something else such as an RFC or other implementation work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions