-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Unable to find modules generated by proc_macro #6258
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
Comments
You can enable proc-macro support using {
"rust-analyzer.cargo.loadOutDirsFromCheck": true,
"rust-analyzer.procMacro.enable": true,
} |
At the beginning I thought that the two parameters (and the fix of the last week, if I remember correctly) would have solved the issue, but unfortunately it does not work. Did you try the repository I linked? I am assuming (and maybe I am wrong) that the issue should not depend on the editor -- I am using NeoVim with CoC and the related rust-analyzer plugin. |
I just tested your reproduction repo. I get the same problems with proc macros enabled. @matklad Is it possible that modules defined by proc macros are ignored? |
Possible, but not intended. |
In ruma, lots of (probably all) proc-macro-generated types are also not found (both generated by a derive macro and a function-like macro). Both should work, right? |
@dodomorandi I just checked that in current master it works, would you like to test it again ? |
@edwin0cheng Thank you for the check! The situation is much better, you are right. I am not sure the completion engine is able to handle things from the modules generated with proc-macro, but I am with NeoVim + CoC, it could also be a different issue. @jplatte are you seeing the same improvements developing ruma? In that case I think we can close this issue 😊 |
Yeah, no issues here anymore 🙂 |
I feel slightly bad for posting this, because I really suspect this can be a PITA.
Crates like
graphql_client
creates a pretty good amount of modules, structs and impls based on graphql files an a few derives. Unfortunately rust-analyzer does not like the situation: it is unable to deduce most of the things, and, even worse, it is unable to detect the modules automatically generated, leaving annoying errors around.I crated a small dummy repository based on the official github example in order to make testing easier, you can find it here.
Please don't hate me for this matklad and others, I am really a huge fan of your work -- it took me more than two weeks to finally think "I just need to let them know"...
The text was updated successfully, but these errors were encountered: