9742: fix: Fix hover range for derive inputs r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-07-31 13:00:09 +00:00 committed by GitHub
commit 3236845d67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

View File

@ -12,8 +12,7 @@ use crate::{
// Assist: invert_if
//
// This transforms if expressions of the form `if !x {A} else {B}` into `if x {B} else {A}`
// This also works with `!=`. This assist can only be applied with the cursor
// on `if`.
// This also works with `!=`. This assist can only be applied with the cursor on `if`.
//
// ```
// fn main() {