Skip to content
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

Does rust-analyzer support cargo check? #1548

Open
hiro-o918 opened this issue Sep 10, 2022 · 3 comments
Open

Does rust-analyzer support cargo check? #1548

hiro-o918 opened this issue Sep 10, 2022 · 3 comments

Comments

@hiro-o918
Copy link

hiro-o918 commented Sep 10, 2022

I found that rust-analyzer based on Bazel does not show cargo check result on VSCode, e.g. when setting up rust analyzer for this example.

I'd like to ask whether this should be a problem because of my environment, or current rules_rust does not support cargo check.

For my understanding, rust-analyzer rules generates rust-project.json to just capture dependences of third parties or project structures.
So we should add another VSCode task to run cargo check with Bazel to show the result of cagro check.

@tkrause
Copy link

tkrause commented Oct 12, 2022

We have the same issue. rust-analyzer does not call cargo check anymore if rust-project.json is specified. Because you may not be using cargo which we aren't we're using bazel.

Instead you need to specify rust-analyzer.checkOnSave.overrideCommand as per https://rust-analyzer.github.io/manual.html#non-cargo-based-projects. However, I'm not sure what that would be in rules_rust.

Just a basic build does not work because the output has to be JSON for rust-analyzer to pick it up.

@googleson78
Copy link
Contributor

See this comment on a similar issue.

@QuentinPerez
Copy link
Contributor

Would be awesome, this is the main reason why I do have to maintain 2 build systems :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants