fix: Rust-Analyzer hover information / redundant spans #2836
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes hope to improve (I wish I could say fix, but I'm not entirely sure yet) the recent issues that the
view!
and#[component]
macros had with providing incorrect / extra information through Rust-Analyzer.In many instances, the procedural macros are spanning tokens with their own span redundantly, while also including lint attributes and unrelated tokens within their spanned interpolation.
I am far from an expert on procedural macros and token spans, while this seems to fix the issues on my editor, I just don't know enough to say if it actually fixes everything. From what I can tell, no diagnostic information is lost from these changes.
Additionally, I have no idea how to write a test for this. I am open to doing additional work to research and write tests if needed.