Skip to content
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

proc_macro::quote cannot be made useful for rust-analyzer #16464

Open
Veykril opened this issue Jan 31, 2024 · 1 comment
Open

proc_macro::quote cannot be made useful for rust-analyzer #16464

Veykril opened this issue Jan 31, 2024 · 1 comment
Labels
A-proc-macro proc macro C-Architecture Big architectural things which we need to figure up-front (or suggestions for rewrites :0) ) C-tracking-issue Category: tracking issue S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@Veykril
Copy link
Member

Veykril commented Jan 31, 2024

Macro in question: https://doc.rust-lang.org/proc_macro/macro.quote.html

What do I mean with this? Basically rust-analyzer cannot make use of the spans the macro generated, as these spans are generated and stored (via save_span) at compilation time of the macro, then loaded (via load_span) by the proc macro server when executed. rust-analyzer is not the tool that compiles the proc-macros though, so we are not the one saving any spans and as such we also can't really load them (even if we go through the artifacts produced, their representation differs from our spans). So for r-a to be able to make use of this feature (should it ever get stabilized), the implementation details would need to change in some way and/or r-a needs to be the one compiling the proc-macros somehow.

@Veykril Veykril added C-Architecture Big architectural things which we need to figure up-front (or suggestions for rewrites :0) ) S-unactionable Issue requires feedback, design decisions or is blocked on other work A-proc-macro proc macro C-tracking-issue Category: tracking issue labels Jan 31, 2024
@Veykril
Copy link
Member Author

Veykril commented Feb 4, 2024

On a related note, assuming wasm based proc-macros are ever to be a thing, this will run into a similar-ish problem there should they be shipped via crates-io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-proc-macro proc macro C-Architecture Big architectural things which we need to figure up-front (or suggestions for rewrites :0) ) C-tracking-issue Category: tracking issue S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

1 participant