mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Remove prev-sibling completion machinery
This commit is contained in:
parent
6550a241fb
commit
522f66545f
3 changed files with 21 additions and 76 deletions
|
@ -15,12 +15,12 @@ pub(crate) fn complete_expr_path(acc: &mut Completions, ctx: &CompletionContext)
|
|||
return;
|
||||
}
|
||||
|
||||
let (is_absolute_path, qualifier, in_block_expr, in_loop_body, is_func_update) =
|
||||
let (is_absolute_path, qualifier, in_block_expr, in_loop_body, is_func_update, after_if_expr) =
|
||||
match ctx.nameref_ctx() {
|
||||
Some(NameRefContext {
|
||||
path_ctx:
|
||||
Some(PathCompletionCtx {
|
||||
kind: PathKind::Expr { in_block_expr, in_loop_body },
|
||||
kind: PathKind::Expr { in_block_expr, in_loop_body, after_if_expr },
|
||||
is_absolute_path,
|
||||
qualifier,
|
||||
..
|
||||
|
@ -33,6 +33,7 @@ pub(crate) fn complete_expr_path(acc: &mut Completions, ctx: &CompletionContext)
|
|||
*in_block_expr,
|
||||
*in_loop_body,
|
||||
record_expr.as_ref().map_or(false, |&(_, it)| it),
|
||||
*after_if_expr,
|
||||
),
|
||||
_ => return,
|
||||
};
|
||||
|
@ -202,7 +203,7 @@ pub(crate) fn complete_expr_path(acc: &mut Completions, ctx: &CompletionContext)
|
|||
add_keyword("let", "let");
|
||||
}
|
||||
|
||||
if ctx.after_if() {
|
||||
if after_if_expr {
|
||||
add_keyword("else", "else {\n $0\n}");
|
||||
add_keyword("else if", "else if $1 {\n $0\n}");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue