Fix various IDE features

As a side benefit, we got `let` guard support for `move_guard` for free.
This commit is contained in:
Chayim Refael Friedman 2022-01-24 00:37:59 +02:00
parent fe1e324694
commit 13ac5c3491
15 changed files with 95 additions and 93 deletions

View file

@ -18,7 +18,7 @@ use syntax::{
algo, ast,
display::{fn_as_proc_macro_label, macro_label},
match_ast, AstNode, Direction,
SyntaxKind::{CONDITION, LET_STMT},
SyntaxKind::{LET_EXPR, LET_STMT},
SyntaxToken, T,
};
@ -484,7 +484,7 @@ fn local(db: &RootDatabase, it: hir::Local) -> Option<Markup> {
let let_kw = if ident
.syntax()
.parent()
.map_or(false, |p| p.kind() == LET_STMT || p.kind() == CONDITION)
.map_or(false, |p| p.kind() == LET_STMT || p.kind() == LET_EXPR)
{
"let "
} else {