-
Notifications
You must be signed in to change notification settings - Fork 475
Visibility suggestions for rust_analyzer? #905
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
Comments
I'm unfortunately not aware of a workaround. One of the stated goals of the rust-analyzer rule (#704) is not to require a list of targets but to have a more 'dynamic' solution for generating |
Why is rust_analyzer insistent on living in the root of the WORKSPACE? I'd be totally fine with |
I think the idea is that if you open your workspace in your IDE, language specific support should be enabled for all your targets. Nearly all the Bazel projects I work with are multi language and most of them are mono-repos so what I'd like to be able to do is open my IDE at the root of the workspace and navigate from project to project. Maybe I misunderstand what you're saying but it sounds like you'd want a |
My expectation was one Honesty I don't know the right solution! I just know that the docs don't "work" using a common visibility label (private or __subpackages__), and should clearly state "while the rule is experimental, rust_* rules must be //visibility:public". In the future, allowing rules to have limited visibility is an important requirement. |
Sorry, I may have been projecting some personal goals vs discussing the actual issue at hand 😅 I do agree that visibility shouldn't prevent you from being able to use Would you be willing to open a pull-request to update the docs? I think that'd be a great start and then hopefully more ideas will surface and we can continue to collaborate on |
The requirements for the rust-project.json location is driven mostly by the mechanism of how the rust-analyzer tool works, documented here. The rust_analyzer rule is currently optimized to work with method 1, auto-discovery, to minimize configuration. This method requires a rust-project.json file at the project root. The other possible configuration would require the user to add a config file with the locations of every rust-project.json file. I completely agree that the current setup requiring the rust_project rule which requires public visibility needs to be fixed. |
Updated the docs in #906, with an explanation in the PR why it must be //visibility:public. Thanks for listening to my concerns, and glad to hear it's on the roadmap as a thing to solve before moving rust_analyzer out of experimental. |
If I understand this correctly, #907 would satisfy the visibility issues brought up here. |
Closing this since #907 has been merged |
Current docs have rust_analyzer at the root, with the WORKSPACE. This rule needs something like
however, this requires all those targets to effectively have
//visibility:public
. Is there any workaround or suggestion on how to not have that requirement?The text was updated successfully, but these errors were encountered: