You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Local" here currently means anything that's not from the registry, so anything inside the workspace, but also path dependencies. So this isn't perfect, and users might still need to use rust-analyzer.cargo.unsetTest for these in some cases.
So I think if I need to manually disable cfg(test) for local path dependencies, I have to use the rust-analyzer.cargo.unsetTest features. After test, I find that it works as what I want.
But recently, there is a new PR #16726 that removes the rust-analyzer.cargo.unsetTest and it is related to project-rust.json. And I cannot use rust-analyzer.cargo.unsetTest in new release of RA.
So my questions is what is project-rust.json? Why can it replace the rust-analyzer.cargo.unsetTest for local path dependencies?
I cannot find any information of using project-rust.json, except the docs. But I still do not know how to use project-rust.json to achieve rust-analyzer.cargo.unsetTest. Is there any example of using project-rust.json that I can copy from?
The text was updated successfully, but these errors were encountered:
rust-project.json projects do not get test set at all unless its specified in your rust-project.json for each crate. It is the responsibility of the tool (or manual author) of the rust-project.json to set the test cfg where wanted.
I think you are mixing up features here, are you working with a rust-project.json or a plain cargo project? rust-project.json is not meant to disable the implicit cargo test cfg. rust-analyzer.cargo.unsetTest was removed as it was mainly a hack for the core library.
In issue #7225, there is a discussion about disable
cfg(test)
and there is a PR #12599 that only enablescfg(test)
for local crates.In PR #12599, it said:
So I think if I need to manually disable
cfg(test)
for local path dependencies, I have to use therust-analyzer.cargo.unsetTest
features. After test, I find that it works as what I want.But recently, there is a new PR #16726 that removes the
rust-analyzer.cargo.unsetTest
and it is related to project-rust.json. And I cannot userust-analyzer.cargo.unsetTest
in new release of RA.So my questions is what is project-rust.json? Why can it replace the
rust-analyzer.cargo.unsetTest
for local path dependencies?I cannot find any information of using project-rust.json, except the docs. But I still do not know how to use project-rust.json to achieve
rust-analyzer.cargo.unsetTest
. Is there any example of using project-rust.json that I can copy from?The text was updated successfully, but these errors were encountered: