-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Incorrect error span in proc_macro #16407
Comments
I tried replacing Replaced code: // Before:
quote! {
DOM(#name)#build
}
// After:
quote_spanned! { node.span() =>
DOM(#name)#build
} As a result, the whole That's strange.... Why |
You should be able to just split the Nice to see that the new adjusted display range function does work as wanted though, that confirms that my changes were useful for diagnostics at least :) |
Seems like debugging code while being sleep deprived is not a good idea 😅 After going though the code with a fresh mind I noticed that Here is PR with applied changes: #16431 |
rust-analyzer version: 0.3.1807-standalone
rustc version: 1.75.0 (82e1608df 2023-12-21)
rustc version (nightly): 1.77.0-nightly (88189a71e 2024-01-19)
relevant settings: none
repo with reproducible example: https://github.com/Ar4ys/rust-analyzer-span-repro
I wanted to fix error reporting from
view!
macro in leptos, so that the wholeview!
macro is not red when one property in some component is not provided. But it seems like I encountered a bug inrust-analyzer
, specifically how it uses spans to report errors (i.e. it reports error over the wholeview!
macro, instead of overComponent
name only):I think this is a bug in
rust-analyzer
, becausecargo build
spans errors correctly (i.e. reports error overComponent
name only, instead of over the wholeview!
macro):Code of the
view!
proc macro:Code that I am using for testing:
The text was updated successfully, but these errors were encountered: