diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index a2df3b895f6..a325acff982 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -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 @@ fn hover_derive_input() { struct Foo; "#, expect![[r#" - *(Copy)* + *Copy* ```rust test @@ -3927,7 +3928,7 @@ mod foo { struct Foo; "#, expect![[r#" - *(foo::Copy)* + *Copy* ```rust test diff --git a/crates/ide_assists/src/handlers/invert_if.rs b/crates/ide_assists/src/handlers/invert_if.rs index 968f2057b47..50aab443a71 100644 --- a/crates/ide_assists/src/handlers/invert_if.rs +++ b/crates/ide_assists/src/handlers/invert_if.rs @@ -12,8 +12,7 @@ // 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() {