aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions/record.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-12 08:41:16 +0000
committerGitHub <[email protected]>2021-03-12 08:41:16 +0000
commitc01ef6eabab1fa70d3fdfed9c565fadec9f0a5ed (patch)
tree37160de8384855fd5fadce3ca4a3de4dacdf98b8 /crates/ide_completion/src/completions/record.rs
parentdb6364fecc2b0e9a95d9aaece820a86265b4cb4f (diff)
parent99c4a41cd1a9f9ef0ee4f067f0069a23123b949a (diff)
Merge #7974
7974: use references in CompletionItem's builder r=matklad a=yonip23 @matklad This is a follow up to [this pr](https://github.com/rust-analyzer/rust-analyzer/pull/7973) Co-authored-by: yonip23 <[email protected]>
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