mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Merge #7498
7498: Clone for update r=matklad a=matklad rowan counterpart https://github.com/rust-analyzer/rowan/pull/93 #6857 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
c49b5b7468
41 changed files with 376 additions and 176 deletions
|
@ -92,7 +92,7 @@ pub(crate) fn hover(
|
|||
|
||||
let mut res = HoverResult::default();
|
||||
|
||||
let node = token.parent();
|
||||
let node = token.parent()?;
|
||||
let definition = match_ast! {
|
||||
match node {
|
||||
// we don't use NameClass::referenced_or_defined here as we do not want to resolve
|
||||
|
@ -421,7 +421,7 @@ fn hover_for_keyword(
|
|||
if !token.kind().is_keyword() {
|
||||
return None;
|
||||
}
|
||||
let famous_defs = FamousDefs(&sema, sema.scope(&token.parent()).krate());
|
||||
let famous_defs = FamousDefs(&sema, sema.scope(&token.parent()?).krate());
|
||||
// std exposes {}_keyword modules with docstrings on the root to document keywords
|
||||
let keyword_mod = format!("{}_keyword", token.text());
|
||||
let doc_owner = find_std_module(&famous_defs, &keyword_mod)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue