mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Don't ignore hover documentation setting for keyword hovers
This commit is contained in:
parent
a93d166f0f
commit
9043c5db86
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,9 +505,10 @@ fn hover_for_keyword(
|
||||||
sema: &hir::Semantics<RootDatabase>,
|
sema: &hir::Semantics<RootDatabase>,
|
||||||
links_in_hover: bool,
|
links_in_hover: bool,
|
||||||
markdown: bool,
|
markdown: bool,
|
||||||
|
documentation: bool,
|
||||||
token: &SyntaxToken,
|
token: &SyntaxToken,
|
||||||
) -> Option<RangeInfo<HoverResult>> {
|
) -> Option<RangeInfo<HoverResult>> {
|
||||||
if !token.kind().is_keyword() {
|
if !token.kind().is_keyword() || documentation {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let famous_defs = FamousDefs(sema, sema.scope(&token.parent()?).krate());
|
let famous_defs = FamousDefs(sema, sema.scope(&token.parent()?).krate());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue