-
Notifications
You must be signed in to change notification settings - Fork 12.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
save-analysis filters out public items #49178
Comments
cc @nrc who I imagine would know the most about this. |
Yeah, macro-generated stuff has caused all kinds of problems in the past. There is a long-term solution which is to handle macro-generated code properly. That means having some representation of the macro-generation in save-analysis and ensuring that all spans are correct (I'm 99% sure that currently there are multiple problems with some spans in the expansion trace). Short-term it depends what you want the save-analysis info for. For RLS/cargo src/searchfox then there is not much of a solution. We could try and be a bit more lenient about what we filter so that some 'obvious' cases get through and maybe that is enough for you (currently we don't filter all macro-generated code, just most of it. For some cases which we know to not cause problems we could let more stuff through). If you want the data for rustdoc or something similar where you don't span info, then we could be even more lenient and include data for macro-generated code, but without the span info (with some kind of configuration option). |
Fair, that makes a lot of sense. The particular use-case which I had for this was more rustdoc-like, so I wanted to be able to see the complete public API of the crate. It might be nice to have this spans-might-be-missing flag, but it might also just make the most sense to wait until the full solution has been implemented. |
Save-analysis has been removed from the compiler. |
save-analysis currently filters out items based on their span - namely, if the item is determined to be "from a macro" according to its span, it will not be included in the saved analysis.
This can mean that items which are part of a crate's public interface are often filtered out. I imagine we should ensure that we never filter out items which are not
#[doc(hidden)]
and are part of a crate's public interface.In addition, a flag should probably be added to the configuration struct to disable generated decl filtering.
The text was updated successfully, but these errors were encountered: