-
Notifications
You must be signed in to change notification settings - Fork 1.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
Does not work for attribute proc macros #6029
Comments
Yes, attribute proc macros are not supported. |
Most features should still work as if the attribute wasn't there though. |
@dakyskye can you confirm that completions are not working? |
@lnicola yes |
Is that Vim? How did you configure |
@lnicola it is NeoVim, yes, with coc.nvim extension. That's the only rust-analyser config I have |
Can you run it (from the same terminal) with |
Weird enough! My output for it is |
|
Can you try https://github.com/fannheyward/coc-rust-analyzer/ instead? I think the official extension doesn't work too well with |
I use |
I have also tried it in VSCode though, the same negative result. |
Does it work for you (in Code) with a new project? |
Sorry, I meant a new project as |
Yes, I did that. |
Ah, you said "master". I have latest release installed, let me build RA myself and try again. EDIT: built rust-analyzer, but the result is same. |
@dakyskye if you run Rust Analyzer: Status command, does it list anything as file deps? |
It started working in VSCode, but still not working in Vim and Emacs. |
I think this is the best place to put this issue. #[add]
struct S; Gets expanded to: struct S { pub field: T } While this compiles without a problem, |
Missing autocompletion is just a symptom of the fact that attribute proc macros are currently unimplemented. |
Yeah, would this explain why mockall_double #[double] macro doesn't work? Cargo check works, but rust analyzer gets confused and looks for Mock type not actual type outside test code. |
Are there any plans to support this feature? |
Yes, it's on the roadmap for the next six weeks: #8486 |
9128: feat: expand procedural attribute macros r=jonas-schievink a=jonas-schievink This adds experimental support for attribute macros. They can be enabled by setting `rust-analyzer.experimental.procAttrMacros` to `true`. Known issues: * Tokens aren't remapped, presumably because we edit the input syntax tree (this causes IDE features to not work inside items with attribute macros on them) * Macro errors aren't reported correctly Closes #8971 Fixes #8964 / la10736/rstest#120 Fixes #2984 Fixes #5412 Fixes #6029 Fixes #6687 #6740 is still not fixed – we now expand `#[proc_macro_hack]`, but fail to expand the resulting `proc_macro_call!()` macro. Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Oh, finally 🎉 🎉 |
rust-analyzer does not work for this file:
No intellisense, no completion, nothing works. I assume it's because of
command
macro?The text was updated successfully, but these errors were encountered: