-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
internal: don't panic when the crate graph isn't ready #19351
internal: don't panic when the crate graph isn't ready #19351
Conversation
ide-diagnostics isn't analysis. Analysis is hir-* crates. The problem with them is that if they depend on We do however have a bunch of other places where we call |
Ah, gotcha: I'll update the comments to say
|
Yes, and there are few others. I suggest you search for this pattern. |
1234fac
to
bb80b01
Compare
Sorry, I should've been clearer: I did and saw them. I was just looking at code that code cause panics during startup. I'll fix the rest in a second. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with few small nits.
bb80b01
to
311f96e
Compare
311f96e
to
788232b
Compare
This comes up when using rust-analyzer with the project discovery functionality (e.g., with Buck or Bazel), as rust-analyzer has started, but the crate graph isn't populated yet. I chose to return with an empty set of diagnostics instead of panicking.
@ChayimFriedman2: I think this qualifies as
RootQueryDb::all_crates
being used in query analysis?