From 0c89f38378c2110cf6c080a5dc837bf7731fef5c Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 4 Jun 2021 19:03:45 +0200 Subject: Replace `-` with `_` in generated lint names --- crates/ide/src/hover.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'crates/ide/src/hover.rs') diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index f3f6f749c..573ffd10d 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -123,6 +123,7 @@ pub(crate) fn hover( _ => { if ast::Comment::cast(token.clone()).is_some() { + cov_mark::hit!(no_highlight_on_comment_hover); let (attributes, def) = doc_attributes(&sema, &node)?; let (docs, doc_mapping) = attributes.docs_with_rangemap(db)?; let (idl_range, link, ns) = @@ -136,8 +137,10 @@ pub(crate) fn hover( })?; range = Some(idl_range); resolve_doc_path_for_def(db, def, &link, ns).map(Definition::ModuleDef) + } else if let res@Some(_) = try_hover_for_attribute(&token) { + return res; } else { - return try_hover_for_attribute(&token); + None } }, } @@ -169,11 +172,6 @@ pub(crate) fn hover( } } - if token.kind() == syntax::SyntaxKind::COMMENT { - cov_mark::hit!(no_highlight_on_comment_hover); - return None; - } - if let res @ Some(_) = hover_for_keyword(&sema, links_in_hover, markdown, &token) { return res; } -- cgit v1.2.3