bazelbuild / bazelbuild/rules_rust

rust-project.json not picked up by rust-analyzer on third_party code

Open
#2,175 1 comment 0 reactions 0 assignees View on GitHub
needs-triage rust-analyzer
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

I ran `bazel run @rules_rust//tools/rust_analyzer:gen_rust_project` and it generates a rust-project.json that provides LSP funcitonality for all first-party code. However, I have some vendored third-party dependencies that I would like to get LSP functionality for as well. Can this be done? I tried passing in @my_third_party//... to the list of targets when running gen_rust_project, but that only adds the targets in the exec root, so the LSP doesn't pick it up when editing the third-party code directly.

Even if I generate the rust-project.json specifically for the third_party code, that doesn't work because rust-analyzer picks up the wrong rust-project.json as far as I can tell.

Any thoughts on how to support this functionality? I'm happy to make PR to work once I have a path forward.

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.