aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-14 14:31:14 +0100
committerLukas Wirth <[email protected]>2021-06-14 14:31:14 +0100
commit9043c5db864ef9bffb4e5e403cf091b073133b40 (patch)
tree42410bb801bc2d5536778f5a6ee3a7af241618e6 /crates
parenta93d166f0fecb748d8cb04aab7f5406bf6308c2d (diff)
Don't ignore hover documentation setting for keyword hovers
Diffstat (limited to 'crates')
-rw-r--r--crates/ide/src/hover.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 23f2b48b4..7b9336d38 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -181,7 +181,8 @@ pub(crate) fn hover(
181 } 181 }
182 } 182 }
183 183
184 if let res @ Some(_) = hover_for_keyword(&sema, links_in_hover, markdown, &token) { 184 if let res @ Some(_) = hover_for_keyword(&sema, links_in_hover, markdown, documentation, &token)
185 {
185 return res; 186 return res;
186 } 187 }
187 188
@@ -504,9 +505,10 @@ fn hover_for_keyword(
504 sema: &hir::Semantics<RootDatabase>, 505 sema: &hir::Semantics<RootDatabase>,
505 links_in_hover: bool, 506 links_in_hover: bool,
506 markdown: bool, 507 markdown: bool,
508 documentation: bool,
507 token: &SyntaxToken, 509 token: &SyntaxToken,
508) -> Option<RangeInfo<HoverResult>> { 510) -> Option<RangeInfo<HoverResult>> {
509 if !token.kind().is_keyword() { 511 if !token.kind().is_keyword() || documentation {
510 return None; 512 return None;
511 } 513 }
512 let famous_defs = FamousDefs(sema, sema.scope(&token.parent()?).krate()); 514 let famous_defs = FamousDefs(sema, sema.scope(&token.parent()?).krate());