From 9043c5db864ef9bffb4e5e403cf091b073133b40 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 14 Jun 2021 15:31:14 +0200 Subject: Don't ignore hover documentation setting for keyword hovers --- crates/ide/src/hover.rs | 6 ++++-- 1 file 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( } } - 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()); -- cgit v1.2.3