Closed dakyskye closed 2 years ago
Yes, attribute proc macros are not supported.
I can't edit the issue title, can you rename it to something like the above?
CC #5412, #2984.
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 rust-analyzer
?
@lnicola it is NeoVim, yes, with coc.nvim extension. That's the only rust-analyser config I have "rust-analyzer.serverPath": "rust-analyzer"
Can you run it (from the same terminal) with rust-analyzer --version
? If you installed from source, it should be under ~/.cargo/bin
, and I'd expect that to be in PATH
, but it doesn't hurt to check.
Weird enough! My output for it is rust-analyzer ???????
. I installed it from the Arch packages.
pacman -Q --info rust-analyzer
outputs Version: 20200914-1
Can you try https://github.com/fannheyward/coc-rust-analyzer/ instead? I think the official extension doesn't work too well with coc.nvim
.
I use coc-rust-analyzer
, but with custom rust-analyzer
path.
I have also tried it in VSCode though, the same negative result.
Does it work for you (in Code) with a new project?
Nope
Sorry, I meant a new project as cargo new
produces.
Yes, I did that.
Can't reproduce, maybe this is fixed in master?
It's weird. I have just tried it in VSCode, Vim and Emacs, works nowhere. VSC result:
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?
I accidentally deleted vscode package, and just reinstalled it. Now rust-analyzer works well for me in VSC. Let me try it in Emacs now
It started working in VSCode, but still not working in Vim and Emacs.
@matklad I am having a similar issue.
Rust analyzer status
workspaces:
54 packages loaded
analysis:
4067 (46mb) files
0 (0b) index symbols
1211 trees, 128 retained
18692 trees, 128 retained (macros)
472mb total
requests:
783 textDocument/semanticTokens/full/delta2ms
784 completionItem/resolve 1ms
785 textDocument/foldingRange 0ms
786 textDocument/codeLens 0ms
787 textDocument/codeAction 1ms
788 textDocument/documentSymbol 0ms
791 textDocument/codeAction 1ms
* 779 textDocument/documentSymbol 0ms
781 rust-analyzer/inlayHints 6ms
782 textDocument/completion 7ms
I should see a bunch of pbx
options (where x is some integer) within the drop down.
You can find the code with a Dockerfile to reproduce the environment here
Any plans to work on this? Is there anything blocking this?
Similar issue with wasm_bindgen
:/ (no typings and no type completion)
Any plans to work on this? Is there anything blocking this?
In short, what needs to be done to get this working is:
#![register_{attr,tool}]
for nightly users https://github.com/rust-analyzer/rust-analyzer/pull/8900I think this is the best place to put this issue.
I have a macro that adds a field to a struct
.
For example:
#[add]
struct S;
Gets expanded to:
struct S { pub field: T }
While this compiles without a problem, rust-analyzer
reports: no such field
.
So, my issue is not about autocomplete, it's just about making the analyzer view the expansion result.
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
Oh, finally 🎉 🎉
rust-analyzer does not work for this file:
No intellisense, no completion, nothing works. I assume it's because of
command
macro?