diff options
author | Lukas Wirth <[email protected]> | 2021-06-07 11:29:46 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-06-07 13:08:05 +0100 |
commit | 4eabcb2c01209065a231e616ba646ba63f68f00d (patch) | |
tree | d07a0ccd1232a53d531c6c3eb00b6cf57f68a85c /crates/ide_completion/src/completions/snippet.rs | |
parent | e475bcdcc671161cf97d86d116a834c540f75f7c (diff) |
Move more things into PathCompletionContext
Diffstat (limited to 'crates/ide_completion/src/completions/snippet.rs')
-rw-r--r-- | crates/ide_completion/src/completions/snippet.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
14 | } | 14 | } |
15 | 15 | ||
16 | pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionContext) { | 16 | pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionContext) { |
17 | if !(ctx.is_trivial_path && ctx.function_def.is_some()) { | 17 | if !(ctx.is_trivial_path() && ctx.function_def.is_some()) { |
18 | return; | 18 | return; |
19 | } | 19 | } |
20 | let cap = match ctx.config.snippet_cap { | 20 | let cap = match ctx.config.snippet_cap { |
@@ -22,7 +22,7 @@ pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionConte | |||
22 | None => return, | 22 | None => return, |
23 | }; | 23 | }; |
24 | 24 | ||
25 | if ctx.can_be_stmt { | 25 | if ctx.can_be_stmt() { |
26 | snippet(ctx, cap, "pd", "eprintln!(\"$0 = {:?}\", $0);").add_to(acc); | 26 | snippet(ctx, cap, "pd", "eprintln!(\"$0 = {:?}\", $0);").add_to(acc); |
27 | snippet(ctx, cap, "ppd", "eprintln!(\"$0 = {:#?}\", $0);").add_to(acc); | 27 | snippet(ctx, cap, "ppd", "eprintln!(\"$0 = {:#?}\", $0);").add_to(acc); |
28 | } | 28 | } |