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
I'd be nice to support a target similar to 'cargo check' entirely inside bazel.
Idea:
By running rustc <file> --error-format=json -Z no-codegen we get an output expected by rust analyzer. With some clever code generation It could allow the user to set checkOnSave.overrideCommand in the rust-project.json to run this target, generating necessary info for rust-analyzer to get proper error highlighting.
Details:
For each generated binary/library/crate, generate a <name>_check target. When running this target, we execute appropriate rustc <files...> --error-format=json -Z no-codegen, returning the errors, warnings in json fomat.
Then, when generating rust-project.json for rust-analyzer, insert "checkOnSave.overrideCommand" : "bazel run <path>_check"
The text was updated successfully, but these errors were encountered:
The "check" part of this is already somewhat possible and working today, with some config options. See #1649
I also gave the "json output" somewhat of a shot in #1657.
The "automatically insert the target into rust-project.json" isn't currently possible afaik, due to the fact that rust-project.json doesn't currently store info about that. See
I'd be nice to support a target similar to 'cargo check' entirely inside bazel.
Idea:
By running
rustc <file> --error-format=json -Z no-codegen
we get an output expected by rust analyzer. With some clever code generation It could allow the user to setcheckOnSave.overrideCommand
in the rust-project.json to run this target, generating necessary info for rust-analyzer to get proper error highlighting.Details:
For each generated binary/library/crate, generate a
<name>_check
target. When running this target, we execute appropriaterustc <files...> --error-format=json -Z no-codegen
, returning the errors, warnings in json fomat.Then, when generating
rust-project.json
for rust-analyzer, insert"checkOnSave.overrideCommand" : "bazel run <path>_check"
The text was updated successfully, but these errors were encountered: