-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Question] What does rust-analyzer expect in rust-project.json for "cyclic" dev-dependencies? #13349
Comments
RA expects there to be no cyclic dependencies. This doesn't work with Cargo projects either. The 'correct' way of modeling this would be to have two separate crates in the graph for the two configurations of C (test and non-test), but we don't do this for Cargo projects either so I don't know how well it would work. |
I tried your suggestion by adding another crate in the graph (suffixed with What's interesting is that it does even better than the "native" cargo solution in that I can now get information even inside the, which should theoretically have a circular dep 🤔 This makes me a bit doubtful that solution works in general, as my example is quite simple, and I could just be getting lucky. But I think it's definitely worth investigating, as if it does work in general, it might be an improvement for Here's the the Additionally, I only left the |
This is a "temporary" workaround because during consolidation, we may merge crates in such a way as to cause a cyclic dependency. For more details, see rust-lang/rust-analyzer#13349 bazelbuild#1589
This is a "temporary" workaround because during consolidation, we may merge crates in such a way as to cause a cyclic dependency. For more details, see rust-lang/rust-analyzer#13349 bazelbuild#1589
This is a "temporary" workaround because during consolidation, we may merge crates in such a way as to cause a cyclic dependency. For more details, see rust-lang/rust-analyzer#13349 bazelbuild#1589
This is a "temporary" workaround because during consolidation, we may merge crates in such a way as to cause a cyclic dependency. For more details, see rust-lang/rust-analyzer#13349 bazelbuild#1589
This is a "temporary" workaround because during consolidation, we may merge crates in such a way as to cause a cyclic dependency. For more details, see rust-lang/rust-analyzer#13349 bazelbuild#1589
Question
When we have a "cyclic" dependency of the form of
X
having itself as adev-dependency
(possibly transitively, e.g.X -dev> A -> B -> X
- see the reproducer below), what kind of data should I put in myrust-project.json
so that it functions correctly?I know thatrust-analyzer
is able to handle this situation, because with acargo
based build, it works just fine - even the things insideX
which really do depend on itself (or in my case depend onA
).EDIT: It seems I had a slip in my perception - it does not function correctly, i.e. in
X
(from the example above) I can't find out information regardingA
(e.g. if I attempt to call a function fromA
I can't go to its definition or look at type information for it).Context
The context is that right now, the
rust-project.json
generator inrules_rust
can't handle a dependency of the formI'm trying to fix this, but I'm not sure what it should output in this case so that
rust-analyzer
can function correctly.Reproducer
Here's a reproducer for the situation with both a Cargo and a Bazel based build.
In it, the dependency situation is as previously described,
The text was updated successfully, but these errors were encountered: