-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Duplicate references in wasm_bindgen types #13407
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
I am seeing same issue in nvim |
i just upgraded to latest |
This behavior is there for at least a year judging from the commits (if not longer), fix is adding a
|
wow, is this something that editors need to take care of, and fixing it in |
No, we can easily fix this in r-a, and I think it makes sense to do so as well. Though I would expect clients to dedup this as well. |
shall i test it and open a PR? |
You are more then welcome to! |
FWIW I bisected the issue to ebfbb31 |
That's not right. Prior to that commit, proc macros didn't work on your rustc version. |
You can use the expansion output directly if you want to bisect it further. |
Ah I thought VS Code would show a warning if the proc_macros weren't expanded in rust-analyzer. Was I supposed to build r-a with a matching older version of rustc? Unfortunately I can't repro the duplicate references in the macro expanded source file. |
I think it should print an error in the logs, at least, not sure when that was added. You can check by running
No, you need to change your project toolchain ( |
i tried adding |
You'll need to do something like https://github.com/rust-lang/rust-analyzer/tree/master/docs/dev#logging (replace |
i am using
|
Try |
When I issue a
textDocument/references
request onMyStruct
in lib.rs, I expect 3 references. Instead I get 288! VSCode seems to dedupe these results before surfacing them in the UI but other editors may not. Dupes are also returned forMyEnum
and its variants. Non-wasm-bindgen
tagged types work fine; presumably other macros also trigger this issue but I don't know enough to debug further.VSCode <-> Rust analyze trace
Expanded lib.rs
rust-analyzer version: 0.3.1238-standalone
rustc version: rustc 1.63.0 (4b91a6ea7 2022-08-08)
The text was updated successfully, but these errors were encountered: