-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Allow filtering analysis by reachability #46011
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
Conversation
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.
Nice! This is easier than I expected - is_reachable
seems very convenient!
What exactly do you need from rls-data? Do we just need to publish a new version from master or is there code that needs to land there too?
&Access { | ||
public: item.vis == ast::Visibility::Public, | ||
reachable: self.save_ctxt.analysis.access_levels.is_reachable(item.id), | ||
}, |
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.
This code looks kinda boilerplatey - could you DRY it out by using a function or macro?
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.
"This code" = initialising Access
For rls_data, I just need the latest code on master, which has the As for removing boilerplate, it would be easy enough to create it from the AccessLevels struct in a helper. I can address that. |
I've published rls-data 0.13 which has the change you need. |
r+ with the rls-data dep change |
aadec89
to
b082f78
Compare
This should be ready to go. |
@bors: r+ |
📌 Commit b082f78 has been approved by |
⌛ Testing commit b082f78 with merge 23132d8c7ea9f986f6f0fb94cfc474bce3853baa... |
💔 Test failed - status-travis |
Failure from multiple
|
Sorry, I'm unfamiliar with how the dist builders work. How can I reproduce this locally? |
@euclio You could run using |
Hm, I'm not able to reproduce the failure locally but I've updated the likely cause. |
@bors r=nrc |
📌 Commit 794ada0 has been approved by |
Allow filtering analysis by reachability Fixes #43521. Fixes rust-dev-tools/rls-analysis#79. This PR allows a user to filter items present in the save-analysis data by setting the `reachable_only` config option. This option is intended for use by the new rustdoc. The PR isn't quite finished, because it's dependent on a new release of rls-data, but I want to make sure that the approach is valid. rust-dev-tools/rls-analysis#79 mentions that `pub use` might need to be handled, but my thinking is that the consumer of the analysis data would be able to infer which imports are `pub use`, and which items are only reachable through `pub use`, so that doesn't need to be handled here. r? @nrc
☀️ Test successful - status-appveyor, status-travis |
Fixes #43521.
Fixes rust-dev-tools/rls-analysis#79.
This PR allows a user to filter items present in the save-analysis data by setting the
reachable_only
config option. This option is intended for use by the new rustdoc. The PR isn't quite finished, because it's dependent on a new release of rls-data, but I want to make sure that the approach is valid.rust-dev-tools/rls-analysis#79 mentions that
pub use
might need to be handled, but my thinking is that the consumer of the analysis data would be able to infer which imports arepub use
, and which items are only reachable throughpub use
, so that doesn't need to be handled here.r? @nrc