diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 23f2b48b45..7b9336d388 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -181,7 +181,8 @@ pub(crate) fn hover( } } - if let res @ Some(_) = hover_for_keyword(&sema, links_in_hover, markdown, &token) { + if let res @ Some(_) = hover_for_keyword(&sema, links_in_hover, markdown, documentation, &token) + { return res; } @@ -504,9 +505,10 @@ fn hover_for_keyword( sema: &hir::Semantics, links_in_hover: bool, markdown: bool, + documentation: bool, token: &SyntaxToken, ) -> Option> { - if !token.kind().is_keyword() { + if !token.kind().is_keyword() || documentation { return None; } let famous_defs = FamousDefs(sema, sema.scope(&token.parent()?).krate());