-
Notifications
You must be signed in to change notification settings - Fork 26
Provide an API to get the visibility of an item #79
Comments
By using a config (see https://github.com/nrc/rls-data/blob/master/src/config.rs) you can request only public items from save-analysis. I think this solves your problem without needing visibility in the analysis data. However, I think it is not quite what you want - you want 'visible' items, not public ones (i.e., a public item in a non-public module should not be included). This needs fixing in the save-analysis crate of the compiler. (I think you may also need to take into account So, why not include visibility info in save-analysis? Basically because it is usually not what you want, you want to know whether an item is visible from a certain place in the code, and the |
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
rust-lang/rust#43521 was fixed five days ago, so this should be unblocked? This bug is still important for new-rustdoc. |
Yep, this should be closed. |
I'm not sure if this issue is better suited here or rust-lang/rust, as I'm not sure if this information is in the analysis data.
This is required for steveklabnik/rustdoc, so we can only document public items.
cc steveklabnik/rustdoc#7
The text was updated successfully, but these errors were encountered: