We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 57ea320 + 37c5b82 commit df1f390Copy full SHA for df1f390
crates/ide/src/hover.rs
@@ -139,6 +139,11 @@ pub(crate) fn hover(
139
}
140
141
142
+ if token.kind() == syntax::SyntaxKind::COMMENT {
143
+ // don't highlight the entire parent node on comment hover
144
+ return None;
145
+ }
146
+
147
let node = token.ancestors().find(|n| {
148
ast::Expr::can_cast(n.kind())
149
|| ast::Pat::can_cast(n.kind())
@@ -3419,4 +3424,15 @@ mod Foo<|> {
3419
3424
"#]],
3420
3425
);
3421
3426
3427
3428
+ #[test]
3429
+ fn hover_comments_dont_highlight_parent() {
3430
+ check_hover_no_result(
3431
+ r#"
3432
+fn no_hover() {
3433
+ // no<|>hover
3434
+}
3435
+"#,
3436
+ );
3437
3422
3438
0 commit comments