From 4eabcb2c01209065a231e616ba646ba63f68f00d Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 7 Jun 2021 12:29:46 +0200 Subject: Move more things into PathCompletionContext --- crates/ide_completion/src/completions/snippet.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide_completion/src/completions/snippet.rs') diff --git a/crates/ide_completion/src/completions/snippet.rs b/crates/ide_completion/src/completions/snippet.rs index 6e6a6eb92..59a338e7b 100644 --- a/crates/ide_completion/src/completions/snippet.rs +++ b/crates/ide_completion/src/completions/snippet.rs @@ -14,7 +14,7 @@ fn snippet(ctx: &CompletionContext, cap: SnippetCap, label: &str, snippet: &str) } pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionContext) { - if !(ctx.is_trivial_path && ctx.function_def.is_some()) { + if !(ctx.is_trivial_path() && ctx.function_def.is_some()) { return; } let cap = match ctx.config.snippet_cap { @@ -22,7 +22,7 @@ pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionConte None => return, }; - if ctx.can_be_stmt { + if ctx.can_be_stmt() { snippet(ctx, cap, "pd", "eprintln!(\"$0 = {:?}\", $0);").add_to(acc); snippet(ctx, cap, "ppd", "eprintln!(\"$0 = {:#?}\", $0);").add_to(acc); } -- cgit v1.2.3