Skip to content

Feature request: Find unused (within workspace) pub symbols #20940

@jplatte

Description

@jplatte

Given RA has "find references", it should also be possible to implement "find things with zero references", right? For (crate-)private symbols this would be redundant with the compiler's unused lints, but for pub symbols, this could be used to find unused things in workspace-internal crates.

I'm thinking you would call this as a global action like SSR or "Show Crate Graph", then get a selector list with all the crates of the workspace to choose which crate's pub symbols to scan, and then RA would pop up the same view it does when showing references to a specific symbol, just that the results would be the pub symbols without any references. Or maybe the pub symbols without any references from other crates (then you'd have to change them all to pub(crate) to see whether they're truly unused).

An action that does this for all non-binary crates of the workspace would surely also be useful for large workspaces that contain no published crates.

Would this be in scope for RA?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions