aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/completion/complete_record.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/complete_record.rs b/crates/ra_ide/src/completion/complete_record.rs
index b180e2388..2352ced5f 100644
--- a/crates/ra_ide/src/completion/complete_record.rs
+++ b/crates/ra_ide/src/completion/complete_record.rs
@@ -410,5 +410,38 @@ mod tests {
410 ] 410 ]
411 "###); 411 "###);
412 } 412 }
413
414 #[test]
415 fn completes_functional_update() {
416 let completions = complete(
417 r"
418 struct S {
419 foo1: u32,
420 foo2: u32,
421 }
422
423 fn main() {
424 let foo1 = 1;
425 let s = S {
426 foo1,
427 <|>
428 .. loop {}
429 }
430 }
431 ",
432 );
433 assert_debug_snapshot!(completions, @r###"
434 [
435 CompletionItem {
436 label: "foo2",
437 source_range: [221; 221),
438 delete: [221; 221),
439 insert: "foo2",
440 kind: Field,
441 detail: "u32",
442 },
443 ]
444 "###);
445 }
413 } 446 }
414} 447}