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

Code completion support in Rust Bazel projects #2633

Open
barbu110 opened this issue Apr 29, 2024 · 2 comments
Open

Code completion support in Rust Bazel projects #2633

barbu110 opened this issue Apr 29, 2024 · 2 comments

Comments

@barbu110
Copy link

Hi folks, not sure if this is the correct place for such a question, but I'm shooting my shot.

I am very excited about the use of Bazel for Rust projects. I am building a project consisting of multiple programming languages, with the largest portion being in Rust and generated code for Protocol Buffer files.

I got everything to build nicely, but code completion is nowhere near any working state. Rust-analyzer simply cannot find anything related to rust_prost_library-generated code or about any other crates in the project.

Is code completion something I'm gonna have to give up to use Bazel or is there a known solution?

@illicitonion
Copy link
Collaborator

Hello! Our hope/intention is that everything works smoothly, but there are definitely corners where rust-analyzer doesn't work if you have a pure-bazel build (and IntelliJ too) - in general I'd expect all of these issues to be solvable, just no one has solved them yet. Contributions are very welcome to improve this coverage!

In the mean time, a lot of folks maintain parallel Cargo and Bazel builds for this reason - I'd love to get to a place where this wasn't necessary.

@barbu110
Copy link
Author

Thanks for the prompt reply!

I was able to get code completion, go to definition, and other such amenities working using the rust_analyzer toolchain. I accidentally stumbled on it.

I'd like to perhaps contribute something to the documentation to help people discover it more easily.

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

No branches or pull requests

2 participants