aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions/record.rs
diff options
context:
space:
mode:
authoryonip23 <[email protected]>2021-03-11 15:46:41 +0000
committeryonip23 <[email protected]>2021-03-11 15:46:41 +0000
commit99c4a41cd1a9f9ef0ee4f067f0069a23123b949a (patch)
tree37160de8384855fd5fadce3ca4a3de4dacdf98b8 /crates/ide_completion/src/completions/record.rs
parentdb6364fecc2b0e9a95d9aaece820a86265b4cb4f (diff)
use references in CompletionItem's builder
Diffstat (limited to 'crates/ide_completion/src/completions/record.rs')
-rw-r--r--crates/ide_completion/src/completions/record.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/crates/ide_completion/src/completions/record.rs b/crates/ide_completion/src/completions/record.rs
index 0a7927eb8..b9af09698 100644
--- a/crates/ide_completion/src/completions/record.rs
+++ b/crates/ide_completion/src/completions/record.rs
@@ -22,16 +22,13 @@ pub(crate) fn complete_record(acc: &mut Completions, ctx: &CompletionContext) ->
22 let completion_text = completion_text 22 let completion_text = completion_text
23 .strip_prefix(ctx.token.to_string().as_str()) 23 .strip_prefix(ctx.token.to_string().as_str())
24 .unwrap_or(completion_text); 24 .unwrap_or(completion_text);
25 acc.add( 25 let mut builder = CompletionItem::new(
26 CompletionItem::new( 26 CompletionKind::Snippet,
27 CompletionKind::Snippet, 27 ctx.source_range(),
28 ctx.source_range(), 28 "..Default::default()",
29 "..Default::default()",
30 )
31 .insert_text(completion_text)
32 .kind(SymbolKind::Field)
33 .build(),
34 ); 29 );
30 builder.insert_text(completion_text).kind(SymbolKind::Field);
31 acc.add(builder.build());
35 } 32 }
36 33
37 missing_fields 34 missing_fields