Fix hover range for derive inputs

This commit is contained in:
Lukas Wirth 2021-07-31 14:47:44 +02:00
parent 7c7c4543da
commit b363755901
2 changed files with 4 additions and 4 deletions

View file

@ -155,6 +155,7 @@ pub(crate) fn hover(
if let res@Some(_) = try_hover_for_lint(&attr, &token) {
return res;
} else {
range = Some(token.text_range());
try_resolve_derive_input_at(&sema, &attr, &token).map(Definition::Macro)
}
} else {
@ -3906,7 +3907,7 @@ pub macro Copy {}
struct Foo;
"#,
expect![[r#"
*(Copy)*
*Copy*
```rust
test
@ -3927,7 +3928,7 @@ mod foo {
struct Foo;
"#,
expect![[r#"
*(foo::Copy)*
*Copy*
```rust
test