New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add rust-analyzer.cargo.allTargets
to configure passing --all-targets
to cargo invocations
#16924
Conversation
5ead5d0
to
5ef60f3
Compare
When working with targets that
passing See the PR referenced above. |
Yes, all other invocations should be check related so thats fine. What we should do is have the check setting inherit the cargo setting here if its unset. Thats how all the other ones work for this pairing |
So the |
5ef60f3
to
ec11701
Compare
…l-targets` to cargo invocations
ec11701
to
174af88
Compare
Thanks! |
☀️ Test successful - checks-actions |
@@ -546,6 +546,11 @@ | |||
"minimum": 0, | |||
"maximum": 255 | |||
}, | |||
"rust-analyzer.cargo.allTargets": { | |||
"markdownDescription": "Pass `--all-targets` to cargo invocation. Overridden by `#rust-analyzer.check.allTargets#`\nwhen the latter is set.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it truly overridden? It seems to me like it is only partially overridden. Specifically, the build script / proc macro build will always use the value of rust-analyzer.cargo.allTargets
even if rust-analyzer.check.allTargets
is set.
If that's correct then the docs are wrong or at least misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I misread this. The docs are wrong here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have precised "for check calls" maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted it in #16988 making it the same as the docs for allFeatures
@@ -1273,6 +1276,7 @@ impl Config { | |||
let sysroot_query_metadata = self.data.cargo_sysrootQueryMetadata; | |||
|
|||
CargoConfig { | |||
all_targets: self.data.cargo_allTargets, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If check_allTargets
is intended to overwrite cargo_allTargets
, then that would have to be done here as well.
Closes #16859
Unresolved question:
Should this be a setting for build scripts only ? All the other
--all-targets
I found where already covered bycheckOnSave.allTargets