Skip to content

rust-analyzer: code is inactive due to #[cfg] directives: test is disabled (inactive-code) #8373

@cyanic-selkie

Description

@cyanic-selkie

Hi,

When using rust-analyzer as Rust's LSP, I keep getting this warning for all #[cfg(test)] code. From what I understand, rust-analyzer is supposed to include the test feature by default.

My language configuration for Rust is:

[[language]]
name = "rust"

[language.config]
checkOnSave = { command = "clippy" } 

I tried setting allTargets to true (which should be true by default anyway) and features to all. However, it doesn't work. Any help is appreciated.

My helix version is 23.05.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions