aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/hover.rs10
1 files changed, 4 insertions, 6 deletions
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(
123 123
124 _ => { 124 _ => {
125 if ast::Comment::cast(token.clone()).is_some() { 125 if ast::Comment::cast(token.clone()).is_some() {
126 cov_mark::hit!(no_highlight_on_comment_hover);
126 let (attributes, def) = doc_attributes(&sema, &node)?; 127 let (attributes, def) = doc_attributes(&sema, &node)?;
127 let (docs, doc_mapping) = attributes.docs_with_rangemap(db)?; 128 let (docs, doc_mapping) = attributes.docs_with_rangemap(db)?;
128 let (idl_range, link, ns) = 129 let (idl_range, link, ns) =
@@ -136,8 +137,10 @@ pub(crate) fn hover(
136 })?; 137 })?;
137 range = Some(idl_range); 138 range = Some(idl_range);
138 resolve_doc_path_for_def(db, def, &link, ns).map(Definition::ModuleDef) 139 resolve_doc_path_for_def(db, def, &link, ns).map(Definition::ModuleDef)
140 } else if let res@Some(_) = try_hover_for_attribute(&token) {
141 return res;
139 } else { 142 } else {
140 return try_hover_for_attribute(&token); 143 None
141 } 144 }
142 }, 145 },
143 } 146 }
@@ -169,11 +172,6 @@ pub(crate) fn hover(
169 } 172 }
170 } 173 }
171 174
172 if token.kind() == syntax::SyntaxKind::COMMENT {
173 cov_mark::hit!(no_highlight_on_comment_hover);
174 return None;
175 }
176
177 if let res @ Some(_) = hover_for_keyword(&sema, links_in_hover, markdown, &token) { 175 if let res @ Some(_) = hover_for_keyword(&sema, links_in_hover, markdown, &token) {
178 return res; 176 return res;
179 } 177 }