Skip to content

rust-analyzer.references.excludeTests should exclude #[cfg(test)] #18573

@glasser

Description

@glasser

#16441 added an awesome new feature to "Find References" to let you ignore tests, and #18212 extended that to "Show call hierarchy" as well.

The goal of this is to help you find where a symbol is used in non-test code. However, the implementation only looks for #[test], and not for #[cfg(test)]. It would be more helpful if this feature also let you skip your test-only test support functions that are not themselves tests: blocks annotated with #[cfg(test)].

@Young-Flash, the author of that PR, agrees: #16441 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-idegeneral IDE featuresC-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions