rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

rust-analyzer.cargo.unsetTest is gone, what should I use as a substitute?

Open vittorius opened this issue 1 year ago • 1 comments

Some time ago, there was an option to disable the "test feature by default". Now it seems to be gone. Is there any alternative way to disable the test feature? My primary goal is to disable it for my main crate in order to get rid of the errors highlighted throughout the codebase while my mocks (covered by #[cfg(test)]) are still incomplete.

vittorius avatar Aug 25 '24 08:08 vittorius

My fix for now is to downgrade to v0.3.1924, but I would be happy to hear if there is an alternative option. Config was removed with this PR: https://github.com/rust-lang/rust-analyzer/pull/16726

iceHtwoO avatar Aug 29 '24 11:08 iceHtwoO

I used the following command to downgrade to a version of rust-analyzer that works correctly with unsetTest. 1.79.0 and above starts ignoring unsetTest.

rustup default 1.78.0 && rustup component add rust-analyzer

srgsanky avatar Sep 22 '24 16:09 srgsanky

I used to unset test on not all crates, only some of them. It doesn't seem like the referenced commit (adding rust-analyzer.cfg.setTest) solves this use-case of the previous feature.

Ten0 avatar Nov 20 '24 10:11 Ten0