aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r--crates/ra_ide_api/src/completion/complete_dot.rs28
-rw-r--r--crates/ra_ide_api/src/completion/complete_fn_param.rs8
-rw-r--r--crates/ra_ide_api/src/completion/complete_keyword.rs28
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs30
-rw-r--r--crates/ra_ide_api/src/completion/complete_pattern.rs4
-rw-r--r--crates/ra_ide_api/src/completion/complete_postfix.rs6
-rw-r--r--crates/ra_ide_api/src/completion/complete_record_literal.rs10
-rw-r--r--crates/ra_ide_api/src/completion/complete_record_pattern.rs6
-rw-r--r--crates/ra_ide_api/src/completion/complete_scope.rs26
-rw-r--r--crates/ra_ide_api/src/completion/complete_snippet.rs10
-rw-r--r--crates/ra_ide_api/src/completion/presentation.rs14
11 files changed, 85 insertions, 85 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs
index 27256f879..2325cdf08 100644
--- a/crates/ra_ide_api/src/completion/complete_dot.rs
+++ b/crates/ra_ide_api/src/completion/complete_dot.rs
@@ -68,7 +68,7 @@ fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty
68#[cfg(test)] 68#[cfg(test)]
69mod tests { 69mod tests {
70 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 70 use crate::completion::{do_completion, CompletionItem, CompletionKind};
71 use insta::assert_debug_snapshot_matches; 71 use insta::assert_debug_snapshot;
72 72
73 fn do_ref_completion(code: &str) -> Vec<CompletionItem> { 73 fn do_ref_completion(code: &str) -> Vec<CompletionItem> {
74 do_completion(code, CompletionKind::Reference) 74 do_completion(code, CompletionKind::Reference)
@@ -76,7 +76,7 @@ mod tests {
76 76
77 #[test] 77 #[test]
78 fn test_struct_field_completion() { 78 fn test_struct_field_completion() {
79 assert_debug_snapshot_matches!( 79 assert_debug_snapshot!(
80 do_ref_completion( 80 do_ref_completion(
81 r" 81 r"
82 struct A { the_field: u32 } 82 struct A { the_field: u32 }
@@ -102,7 +102,7 @@ mod tests {
102 102
103 #[test] 103 #[test]
104 fn test_struct_field_completion_self() { 104 fn test_struct_field_completion_self() {
105 assert_debug_snapshot_matches!( 105 assert_debug_snapshot!(
106 do_ref_completion( 106 do_ref_completion(
107 r" 107 r"
108 struct A { 108 struct A {
@@ -144,7 +144,7 @@ mod tests {
144 144
145 #[test] 145 #[test]
146 fn test_struct_field_completion_autoderef() { 146 fn test_struct_field_completion_autoderef() {
147 assert_debug_snapshot_matches!( 147 assert_debug_snapshot!(
148 do_ref_completion( 148 do_ref_completion(
149 r" 149 r"
150 struct A { the_field: (u32, i32) } 150 struct A { the_field: (u32, i32) }
@@ -180,7 +180,7 @@ mod tests {
180 180
181 #[test] 181 #[test]
182 fn test_no_struct_field_completion_for_method_call() { 182 fn test_no_struct_field_completion_for_method_call() {
183 assert_debug_snapshot_matches!( 183 assert_debug_snapshot!(
184 do_ref_completion( 184 do_ref_completion(
185 r" 185 r"
186 struct A { the_field: u32 } 186 struct A { the_field: u32 }
@@ -195,7 +195,7 @@ mod tests {
195 195
196 #[test] 196 #[test]
197 fn test_method_completion() { 197 fn test_method_completion() {
198 assert_debug_snapshot_matches!( 198 assert_debug_snapshot!(
199 do_ref_completion( 199 do_ref_completion(
200 r" 200 r"
201 struct A {} 201 struct A {}
@@ -224,7 +224,7 @@ mod tests {
224 224
225 #[test] 225 #[test]
226 fn test_trait_method_completion() { 226 fn test_trait_method_completion() {
227 assert_debug_snapshot_matches!( 227 assert_debug_snapshot!(
228 do_ref_completion( 228 do_ref_completion(
229 r" 229 r"
230 struct A {} 230 struct A {}
@@ -252,7 +252,7 @@ mod tests {
252 252
253 #[test] 253 #[test]
254 fn test_trait_method_completion_deduplicated() { 254 fn test_trait_method_completion_deduplicated() {
255 assert_debug_snapshot_matches!( 255 assert_debug_snapshot!(
256 do_ref_completion( 256 do_ref_completion(
257 r" 257 r"
258 struct A {} 258 struct A {}
@@ -280,7 +280,7 @@ mod tests {
280 280
281 #[test] 281 #[test]
282 fn test_no_non_self_method() { 282 fn test_no_non_self_method() {
283 assert_debug_snapshot_matches!( 283 assert_debug_snapshot!(
284 do_ref_completion( 284 do_ref_completion(
285 r" 285 r"
286 struct A {} 286 struct A {}
@@ -298,7 +298,7 @@ mod tests {
298 298
299 #[test] 299 #[test]
300 fn test_method_attr_filtering() { 300 fn test_method_attr_filtering() {
301 assert_debug_snapshot_matches!( 301 assert_debug_snapshot!(
302 do_ref_completion( 302 do_ref_completion(
303 r" 303 r"
304 struct A {} 304 struct A {}
@@ -331,7 +331,7 @@ mod tests {
331 331
332 #[test] 332 #[test]
333 fn test_tuple_field_completion() { 333 fn test_tuple_field_completion() {
334 assert_debug_snapshot_matches!( 334 assert_debug_snapshot!(
335 do_ref_completion( 335 do_ref_completion(
336 r" 336 r"
337 fn foo() { 337 fn foo() {
@@ -365,7 +365,7 @@ mod tests {
365 365
366 #[test] 366 #[test]
367 fn test_tuple_field_inference() { 367 fn test_tuple_field_inference() {
368 assert_debug_snapshot_matches!( 368 assert_debug_snapshot!(
369 do_ref_completion( 369 do_ref_completion(
370 r" 370 r"
371 pub struct S; 371 pub struct S;
@@ -400,7 +400,7 @@ mod tests {
400 400
401 #[test] 401 #[test]
402 fn test_completion_works_in_consts() { 402 fn test_completion_works_in_consts() {
403 assert_debug_snapshot_matches!( 403 assert_debug_snapshot!(
404 do_ref_completion( 404 do_ref_completion(
405 r" 405 r"
406 struct A { the_field: u32 } 406 struct A { the_field: u32 }
@@ -426,7 +426,7 @@ mod tests {
426 426
427 #[test] 427 #[test]
428 fn test_completion_await_impls_future() { 428 fn test_completion_await_impls_future() {
429 assert_debug_snapshot_matches!( 429 assert_debug_snapshot!(
430 do_completion( 430 do_completion(
431 r###" 431 r###"
432 //- /main.rs 432 //- /main.rs
diff --git a/crates/ra_ide_api/src/completion/complete_fn_param.rs b/crates/ra_ide_api/src/completion/complete_fn_param.rs
index 0887ef1f6..6639b6fff 100644
--- a/crates/ra_ide_api/src/completion/complete_fn_param.rs
+++ b/crates/ra_ide_api/src/completion/complete_fn_param.rs
@@ -51,7 +51,7 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext)
51#[cfg(test)] 51#[cfg(test)]
52mod tests { 52mod tests {
53 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 53 use crate::completion::{do_completion, CompletionItem, CompletionKind};
54 use insta::assert_debug_snapshot_matches; 54 use insta::assert_debug_snapshot;
55 55
56 fn do_magic_completion(code: &str) -> Vec<CompletionItem> { 56 fn do_magic_completion(code: &str) -> Vec<CompletionItem> {
57 do_completion(code, CompletionKind::Magic) 57 do_completion(code, CompletionKind::Magic)
@@ -59,7 +59,7 @@ mod tests {
59 59
60 #[test] 60 #[test]
61 fn test_param_completion_last_param() { 61 fn test_param_completion_last_param() {
62 assert_debug_snapshot_matches!( 62 assert_debug_snapshot!(
63 do_magic_completion( 63 do_magic_completion(
64 r" 64 r"
65 fn foo(file_id: FileId) {} 65 fn foo(file_id: FileId) {}
@@ -83,7 +83,7 @@ mod tests {
83 83
84 #[test] 84 #[test]
85 fn test_param_completion_nth_param() { 85 fn test_param_completion_nth_param() {
86 assert_debug_snapshot_matches!( 86 assert_debug_snapshot!(
87 do_magic_completion( 87 do_magic_completion(
88 r" 88 r"
89 fn foo(file_id: FileId) {} 89 fn foo(file_id: FileId) {}
@@ -107,7 +107,7 @@ mod tests {
107 107
108 #[test] 108 #[test]
109 fn test_param_completion_trait_param() { 109 fn test_param_completion_trait_param() {
110 assert_debug_snapshot_matches!( 110 assert_debug_snapshot!(
111 do_magic_completion( 111 do_magic_completion(
112 r" 112 r"
113 pub(crate) trait SourceRoot { 113 pub(crate) trait SourceRoot {
diff --git a/crates/ra_ide_api/src/completion/complete_keyword.rs b/crates/ra_ide_api/src/completion/complete_keyword.rs
index 18c1839dc..c527a9f63 100644
--- a/crates/ra_ide_api/src/completion/complete_keyword.rs
+++ b/crates/ra_ide_api/src/completion/complete_keyword.rs
@@ -113,7 +113,7 @@ fn complete_return(
113#[cfg(test)] 113#[cfg(test)]
114mod tests { 114mod tests {
115 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 115 use crate::completion::{do_completion, CompletionItem, CompletionKind};
116 use insta::assert_debug_snapshot_matches; 116 use insta::assert_debug_snapshot;
117 117
118 fn do_keyword_completion(code: &str) -> Vec<CompletionItem> { 118 fn do_keyword_completion(code: &str) -> Vec<CompletionItem> {
119 do_completion(code, CompletionKind::Keyword) 119 do_completion(code, CompletionKind::Keyword)
@@ -121,7 +121,7 @@ mod tests {
121 121
122 #[test] 122 #[test]
123 fn completes_keywords_in_use_stmt() { 123 fn completes_keywords_in_use_stmt() {
124 assert_debug_snapshot_matches!( 124 assert_debug_snapshot!(
125 do_keyword_completion( 125 do_keyword_completion(
126 r" 126 r"
127 use <|> 127 use <|>
@@ -152,7 +152,7 @@ mod tests {
152]"### 152]"###
153 ); 153 );
154 154
155 assert_debug_snapshot_matches!( 155 assert_debug_snapshot!(
156 do_keyword_completion( 156 do_keyword_completion(
157 r" 157 r"
158 use a::<|> 158 use a::<|>
@@ -176,7 +176,7 @@ mod tests {
176]"### 176]"###
177 ); 177 );
178 178
179 assert_debug_snapshot_matches!( 179 assert_debug_snapshot!(
180 do_keyword_completion( 180 do_keyword_completion(
181 r" 181 r"
182 use a::{b, <|>} 182 use a::{b, <|>}
@@ -203,7 +203,7 @@ mod tests {
203 203
204 #[test] 204 #[test]
205 fn completes_various_keywords_in_function() { 205 fn completes_various_keywords_in_function() {
206 assert_debug_snapshot_matches!( 206 assert_debug_snapshot!(
207 do_keyword_completion( 207 do_keyword_completion(
208 r" 208 r"
209 fn quux() { 209 fn quux() {
@@ -253,7 +253,7 @@ mod tests {
253 253
254 #[test] 254 #[test]
255 fn completes_else_after_if() { 255 fn completes_else_after_if() {
256 assert_debug_snapshot_matches!( 256 assert_debug_snapshot!(
257 do_keyword_completion( 257 do_keyword_completion(
258 r" 258 r"
259 fn quux() { 259 fn quux() {
@@ -319,7 +319,7 @@ mod tests {
319 319
320 #[test] 320 #[test]
321 fn test_completion_return_value() { 321 fn test_completion_return_value() {
322 assert_debug_snapshot_matches!( 322 assert_debug_snapshot!(
323 do_keyword_completion( 323 do_keyword_completion(
324 r" 324 r"
325 fn quux() -> i32 { 325 fn quux() -> i32 {
@@ -366,7 +366,7 @@ mod tests {
366 }, 366 },
367]"### 367]"###
368 ); 368 );
369 assert_debug_snapshot_matches!( 369 assert_debug_snapshot!(
370 do_keyword_completion( 370 do_keyword_completion(
371 r" 371 r"
372 fn quux() { 372 fn quux() {
@@ -417,7 +417,7 @@ mod tests {
417 417
418 #[test] 418 #[test]
419 fn dont_add_semi_after_return_if_not_a_statement() { 419 fn dont_add_semi_after_return_if_not_a_statement() {
420 assert_debug_snapshot_matches!( 420 assert_debug_snapshot!(
421 do_keyword_completion( 421 do_keyword_completion(
422 r" 422 r"
423 fn quux() -> i32 { 423 fn quux() -> i32 {
@@ -469,7 +469,7 @@ mod tests {
469 469
470 #[test] 470 #[test]
471 fn last_return_in_block_has_semi() { 471 fn last_return_in_block_has_semi() {
472 assert_debug_snapshot_matches!( 472 assert_debug_snapshot!(
473 do_keyword_completion( 473 do_keyword_completion(
474 r" 474 r"
475 fn quux() -> i32 { 475 fn quux() -> i32 {
@@ -517,7 +517,7 @@ mod tests {
517 }, 517 },
518]"### 518]"###
519 ); 519 );
520 assert_debug_snapshot_matches!( 520 assert_debug_snapshot!(
521 do_keyword_completion( 521 do_keyword_completion(
522 r" 522 r"
523 fn quux() -> i32 { 523 fn quux() -> i32 {
@@ -571,7 +571,7 @@ mod tests {
571 571
572 #[test] 572 #[test]
573 fn completes_break_and_continue_in_loops() { 573 fn completes_break_and_continue_in_loops() {
574 assert_debug_snapshot_matches!( 574 assert_debug_snapshot!(
575 do_keyword_completion( 575 do_keyword_completion(
576 r" 576 r"
577 fn quux() -> i32 { 577 fn quux() -> i32 {
@@ -633,7 +633,7 @@ mod tests {
633 ); 633 );
634 634
635 // No completion: lambda isolates control flow 635 // No completion: lambda isolates control flow
636 assert_debug_snapshot_matches!( 636 assert_debug_snapshot!(
637 do_keyword_completion( 637 do_keyword_completion(
638 r" 638 r"
639 fn quux() -> i32 { 639 fn quux() -> i32 {
@@ -683,7 +683,7 @@ mod tests {
683 683
684 #[test] 684 #[test]
685 fn no_semi_after_break_continue_in_expr() { 685 fn no_semi_after_break_continue_in_expr() {
686 assert_debug_snapshot_matches!( 686 assert_debug_snapshot!(
687 do_keyword_completion( 687 do_keyword_completion(
688 r" 688 r"
689 fn f() { 689 fn f() {
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs
index 5fd41eeb3..d6b5ac9ad 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -79,7 +79,7 @@ mod tests {
79 use test_utils::covers; 79 use test_utils::covers;
80 80
81 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 81 use crate::completion::{do_completion, CompletionItem, CompletionKind};
82 use insta::assert_debug_snapshot_matches; 82 use insta::assert_debug_snapshot;
83 83
84 fn do_reference_completion(code: &str) -> Vec<CompletionItem> { 84 fn do_reference_completion(code: &str) -> Vec<CompletionItem> {
85 do_completion(code, CompletionKind::Reference) 85 do_completion(code, CompletionKind::Reference)
@@ -120,7 +120,7 @@ mod tests {
120 120
121 #[test] 121 #[test]
122 fn completes_mod_with_docs() { 122 fn completes_mod_with_docs() {
123 assert_debug_snapshot_matches!( 123 assert_debug_snapshot!(
124 do_reference_completion( 124 do_reference_completion(
125 r" 125 r"
126 use self::my<|>; 126 use self::my<|>;
@@ -149,7 +149,7 @@ mod tests {
149 149
150 #[test] 150 #[test]
151 fn completes_use_item_starting_with_self() { 151 fn completes_use_item_starting_with_self() {
152 assert_debug_snapshot_matches!( 152 assert_debug_snapshot!(
153 do_reference_completion( 153 do_reference_completion(
154 r" 154 r"
155 use self::m::<|>; 155 use self::m::<|>;
@@ -173,7 +173,7 @@ mod tests {
173 173
174 #[test] 174 #[test]
175 fn completes_use_item_starting_with_crate() { 175 fn completes_use_item_starting_with_crate() {
176 assert_debug_snapshot_matches!( 176 assert_debug_snapshot!(
177 do_reference_completion( 177 do_reference_completion(
178 " 178 "
179 //- /lib.rs 179 //- /lib.rs
@@ -204,7 +204,7 @@ mod tests {
204 204
205 #[test] 205 #[test]
206 fn completes_nested_use_tree() { 206 fn completes_nested_use_tree() {
207 assert_debug_snapshot_matches!( 207 assert_debug_snapshot!(
208 do_reference_completion( 208 do_reference_completion(
209 " 209 "
210 //- /lib.rs 210 //- /lib.rs
@@ -235,7 +235,7 @@ mod tests {
235 235
236 #[test] 236 #[test]
237 fn completes_deeply_nested_use_tree() { 237 fn completes_deeply_nested_use_tree() {
238 assert_debug_snapshot_matches!( 238 assert_debug_snapshot!(
239 do_reference_completion( 239 do_reference_completion(
240 " 240 "
241 //- /lib.rs 241 //- /lib.rs
@@ -263,7 +263,7 @@ mod tests {
263 263
264 #[test] 264 #[test]
265 fn completes_enum_variant() { 265 fn completes_enum_variant() {
266 assert_debug_snapshot_matches!( 266 assert_debug_snapshot!(
267 do_reference_completion( 267 do_reference_completion(
268 " 268 "
269 //- /lib.rs 269 //- /lib.rs
@@ -306,7 +306,7 @@ mod tests {
306 306
307 #[test] 307 #[test]
308 fn completes_enum_variant_with_details() { 308 fn completes_enum_variant_with_details() {
309 assert_debug_snapshot_matches!( 309 assert_debug_snapshot!(
310 do_reference_completion( 310 do_reference_completion(
311 " 311 "
312 //- /lib.rs 312 //- /lib.rs
@@ -363,7 +363,7 @@ mod tests {
363 363
364 #[test] 364 #[test]
365 fn completes_struct_associated_method() { 365 fn completes_struct_associated_method() {
366 assert_debug_snapshot_matches!( 366 assert_debug_snapshot!(
367 do_reference_completion( 367 do_reference_completion(
368 " 368 "
369 //- /lib.rs 369 //- /lib.rs
@@ -396,7 +396,7 @@ mod tests {
396 396
397 #[test] 397 #[test]
398 fn completes_struct_associated_const() { 398 fn completes_struct_associated_const() {
399 assert_debug_snapshot_matches!( 399 assert_debug_snapshot!(
400 do_reference_completion( 400 do_reference_completion(
401 " 401 "
402 //- /lib.rs 402 //- /lib.rs
@@ -429,7 +429,7 @@ mod tests {
429 429
430 #[test] 430 #[test]
431 fn completes_struct_associated_type() { 431 fn completes_struct_associated_type() {
432 assert_debug_snapshot_matches!( 432 assert_debug_snapshot!(
433 do_reference_completion( 433 do_reference_completion(
434 " 434 "
435 //- /lib.rs 435 //- /lib.rs
@@ -462,7 +462,7 @@ mod tests {
462 462
463 #[test] 463 #[test]
464 fn completes_enum_associated_method() { 464 fn completes_enum_associated_method() {
465 assert_debug_snapshot_matches!( 465 assert_debug_snapshot!(
466 do_reference_completion( 466 do_reference_completion(
467 " 467 "
468 //- /lib.rs 468 //- /lib.rs
@@ -495,7 +495,7 @@ mod tests {
495 495
496 #[test] 496 #[test]
497 fn completes_union_associated_method() { 497 fn completes_union_associated_method() {
498 assert_debug_snapshot_matches!( 498 assert_debug_snapshot!(
499 do_reference_completion( 499 do_reference_completion(
500 " 500 "
501 //- /lib.rs 501 //- /lib.rs
@@ -528,7 +528,7 @@ mod tests {
528 528
529 #[test] 529 #[test]
530 fn completes_use_paths_across_crates() { 530 fn completes_use_paths_across_crates() {
531 assert_debug_snapshot_matches!( 531 assert_debug_snapshot!(
532 do_reference_completion( 532 do_reference_completion(
533 " 533 "
534 //- /main.rs 534 //- /main.rs
@@ -554,7 +554,7 @@ mod tests {
554 554
555 #[test] 555 #[test]
556 fn completes_type_alias() { 556 fn completes_type_alias() {
557 assert_debug_snapshot_matches!( 557 assert_debug_snapshot!(
558 do_reference_completion( 558 do_reference_completion(
559 " 559 "
560 struct S; 560 struct S;
diff --git a/crates/ra_ide_api/src/completion/complete_pattern.rs b/crates/ra_ide_api/src/completion/complete_pattern.rs
index f12dfcc17..fb02844fa 100644
--- a/crates/ra_ide_api/src/completion/complete_pattern.rs
+++ b/crates/ra_ide_api/src/completion/complete_pattern.rs
@@ -28,7 +28,7 @@ pub(super) fn complete_pattern(acc: &mut Completions, ctx: &CompletionContext) {
28#[cfg(test)] 28#[cfg(test)]
29mod tests { 29mod tests {
30 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 30 use crate::completion::{do_completion, CompletionItem, CompletionKind};
31 use insta::assert_debug_snapshot_matches; 31 use insta::assert_debug_snapshot;
32 32
33 fn complete(code: &str) -> Vec<CompletionItem> { 33 fn complete(code: &str) -> Vec<CompletionItem> {
34 do_completion(code, CompletionKind::Reference) 34 do_completion(code, CompletionKind::Reference)
@@ -53,7 +53,7 @@ mod tests {
53 } 53 }
54 ", 54 ",
55 ); 55 );
56 assert_debug_snapshot_matches!(completions, @r###" 56 assert_debug_snapshot!(completions, @r###"
57 â‹®[ 57 â‹®[
58 â‹® CompletionItem { 58 â‹® CompletionItem {
59 â‹® label: "E", 59 â‹® label: "E",
diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide_api/src/completion/complete_postfix.rs
index 6d834f6ce..3970d1af3 100644
--- a/crates/ra_ide_api/src/completion/complete_postfix.rs
+++ b/crates/ra_ide_api/src/completion/complete_postfix.rs
@@ -72,7 +72,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
72#[cfg(test)] 72#[cfg(test)]
73mod tests { 73mod tests {
74 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 74 use crate::completion::{do_completion, CompletionItem, CompletionKind};
75 use insta::assert_debug_snapshot_matches; 75 use insta::assert_debug_snapshot;
76 76
77 fn do_postfix_completion(code: &str) -> Vec<CompletionItem> { 77 fn do_postfix_completion(code: &str) -> Vec<CompletionItem> {
78 do_completion(code, CompletionKind::Postfix) 78 do_completion(code, CompletionKind::Postfix)
@@ -80,7 +80,7 @@ mod tests {
80 80
81 #[test] 81 #[test]
82 fn postfix_completion_works_for_trivial_path_expression() { 82 fn postfix_completion_works_for_trivial_path_expression() {
83 assert_debug_snapshot_matches!( 83 assert_debug_snapshot!(
84 do_postfix_completion( 84 do_postfix_completion(
85 r#" 85 r#"
86 fn main() { 86 fn main() {
@@ -152,7 +152,7 @@ mod tests {
152 152
153 #[test] 153 #[test]
154 fn some_postfix_completions_ignored() { 154 fn some_postfix_completions_ignored() {
155 assert_debug_snapshot_matches!( 155 assert_debug_snapshot!(
156 do_postfix_completion( 156 do_postfix_completion(
157 r#" 157 r#"
158 fn main() { 158 fn main() {
diff --git a/crates/ra_ide_api/src/completion/complete_record_literal.rs b/crates/ra_ide_api/src/completion/complete_record_literal.rs
index 6b929a8ac..ed4029964 100644
--- a/crates/ra_ide_api/src/completion/complete_record_literal.rs
+++ b/crates/ra_ide_api/src/completion/complete_record_literal.rs
@@ -23,7 +23,7 @@ pub(super) fn complete_record_literal(acc: &mut Completions, ctx: &CompletionCon
23#[cfg(test)] 23#[cfg(test)]
24mod tests { 24mod tests {
25 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 25 use crate::completion::{do_completion, CompletionItem, CompletionKind};
26 use insta::assert_debug_snapshot_matches; 26 use insta::assert_debug_snapshot;
27 27
28 fn complete(code: &str) -> Vec<CompletionItem> { 28 fn complete(code: &str) -> Vec<CompletionItem> {
29 do_completion(code, CompletionKind::Reference) 29 do_completion(code, CompletionKind::Reference)
@@ -39,7 +39,7 @@ mod tests {
39 } 39 }
40 ", 40 ",
41 ); 41 );
42 assert_debug_snapshot_matches!(completions, @r###" 42 assert_debug_snapshot!(completions, @r###"
43 â‹®[ 43 â‹®[
44 â‹® CompletionItem { 44 â‹® CompletionItem {
45 â‹® label: "the_field", 45 â‹® label: "the_field",
@@ -65,7 +65,7 @@ mod tests {
65 } 65 }
66 ", 66 ",
67 ); 67 );
68 assert_debug_snapshot_matches!(completions, @r###" 68 assert_debug_snapshot!(completions, @r###"
69 â‹®[ 69 â‹®[
70 â‹® CompletionItem { 70 â‹® CompletionItem {
71 â‹® label: "a", 71 â‹® label: "a",
@@ -91,7 +91,7 @@ mod tests {
91 } 91 }
92 ", 92 ",
93 ); 93 );
94 assert_debug_snapshot_matches!(completions, @r###" 94 assert_debug_snapshot!(completions, @r###"
95 â‹®[ 95 â‹®[
96 â‹® CompletionItem { 96 â‹® CompletionItem {
97 â‹® label: "b", 97 â‹® label: "b",
@@ -116,7 +116,7 @@ mod tests {
116 } 116 }
117 ", 117 ",
118 ); 118 );
119 assert_debug_snapshot_matches!(completions, @r###" 119 assert_debug_snapshot!(completions, @r###"
120 â‹®[ 120 â‹®[
121 â‹® CompletionItem { 121 â‹® CompletionItem {
122 â‹® label: "a", 122 â‹® label: "a",
diff --git a/crates/ra_ide_api/src/completion/complete_record_pattern.rs b/crates/ra_ide_api/src/completion/complete_record_pattern.rs
index 8c8b47ea4..70716b3d6 100644
--- a/crates/ra_ide_api/src/completion/complete_record_pattern.rs
+++ b/crates/ra_ide_api/src/completion/complete_record_pattern.rs
@@ -22,7 +22,7 @@ pub(super) fn complete_record_pattern(acc: &mut Completions, ctx: &CompletionCon
22#[cfg(test)] 22#[cfg(test)]
23mod tests { 23mod tests {
24 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 24 use crate::completion::{do_completion, CompletionItem, CompletionKind};
25 use insta::assert_debug_snapshot_matches; 25 use insta::assert_debug_snapshot;
26 26
27 fn complete(code: &str) -> Vec<CompletionItem> { 27 fn complete(code: &str) -> Vec<CompletionItem> {
28 do_completion(code, CompletionKind::Reference) 28 do_completion(code, CompletionKind::Reference)
@@ -41,7 +41,7 @@ mod tests {
41 } 41 }
42 ", 42 ",
43 ); 43 );
44 assert_debug_snapshot_matches!(completions, @r###" 44 assert_debug_snapshot!(completions, @r###"
45 â‹®[ 45 â‹®[
46 â‹® CompletionItem { 46 â‹® CompletionItem {
47 â‹® label: "foo", 47 â‹® label: "foo",
@@ -70,7 +70,7 @@ mod tests {
70 } 70 }
71 ", 71 ",
72 ); 72 );
73 assert_debug_snapshot_matches!(completions, @r###" 73 assert_debug_snapshot!(completions, @r###"
74 â‹®[ 74 â‹®[
75 â‹® CompletionItem { 75 â‹® CompletionItem {
76 â‹® label: "bar", 76 â‹® label: "bar",
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs
index 2000d953a..d6a44c3e0 100644
--- a/crates/ra_ide_api/src/completion/complete_scope.rs
+++ b/crates/ra_ide_api/src/completion/complete_scope.rs
@@ -122,7 +122,7 @@ impl ImportResolver {
122#[cfg(test)] 122#[cfg(test)]
123mod tests { 123mod tests {
124 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 124 use crate::completion::{do_completion, CompletionItem, CompletionKind};
125 use insta::assert_debug_snapshot_matches; 125 use insta::assert_debug_snapshot;
126 126
127 fn do_reference_completion(code: &str) -> Vec<CompletionItem> { 127 fn do_reference_completion(code: &str) -> Vec<CompletionItem> {
128 do_completion(code, CompletionKind::Reference) 128 do_completion(code, CompletionKind::Reference)
@@ -130,7 +130,7 @@ mod tests {
130 130
131 #[test] 131 #[test]
132 fn completes_bindings_from_let() { 132 fn completes_bindings_from_let() {
133 assert_debug_snapshot_matches!( 133 assert_debug_snapshot!(
134 do_reference_completion( 134 do_reference_completion(
135 r" 135 r"
136 fn quux(x: i32) { 136 fn quux(x: i32) {
@@ -171,7 +171,7 @@ mod tests {
171 171
172 #[test] 172 #[test]
173 fn completes_bindings_from_if_let() { 173 fn completes_bindings_from_if_let() {
174 assert_debug_snapshot_matches!( 174 assert_debug_snapshot!(
175 do_reference_completion( 175 do_reference_completion(
176 r" 176 r"
177 fn quux() { 177 fn quux() {
@@ -215,7 +215,7 @@ mod tests {
215 215
216 #[test] 216 #[test]
217 fn completes_bindings_from_for() { 217 fn completes_bindings_from_for() {
218 assert_debug_snapshot_matches!( 218 assert_debug_snapshot!(
219 do_reference_completion( 219 do_reference_completion(
220 r" 220 r"
221 fn quux() { 221 fn quux() {
@@ -247,7 +247,7 @@ mod tests {
247 247
248 #[test] 248 #[test]
249 fn completes_generic_params() { 249 fn completes_generic_params() {
250 assert_debug_snapshot_matches!( 250 assert_debug_snapshot!(
251 do_reference_completion( 251 do_reference_completion(
252 r" 252 r"
253 fn quux<T>() { 253 fn quux<T>() {
@@ -277,7 +277,7 @@ mod tests {
277 277
278 #[test] 278 #[test]
279 fn completes_generic_params_in_struct() { 279 fn completes_generic_params_in_struct() {
280 assert_debug_snapshot_matches!( 280 assert_debug_snapshot!(
281 do_reference_completion( 281 do_reference_completion(
282 r" 282 r"
283 struct X<T> { 283 struct X<T> {
@@ -306,7 +306,7 @@ mod tests {
306 306
307 #[test] 307 #[test]
308 fn completes_module_items() { 308 fn completes_module_items() {
309 assert_debug_snapshot_matches!( 309 assert_debug_snapshot!(
310 do_reference_completion( 310 do_reference_completion(
311 r" 311 r"
312 struct Foo; 312 struct Foo;
@@ -345,7 +345,7 @@ mod tests {
345 345
346 #[test] 346 #[test]
347 fn completes_extern_prelude() { 347 fn completes_extern_prelude() {
348 assert_debug_snapshot_matches!( 348 assert_debug_snapshot!(
349 do_reference_completion( 349 do_reference_completion(
350 r" 350 r"
351 //- /lib.rs 351 //- /lib.rs
@@ -369,7 +369,7 @@ mod tests {
369 369
370 #[test] 370 #[test]
371 fn completes_module_items_in_nested_modules() { 371 fn completes_module_items_in_nested_modules() {
372 assert_debug_snapshot_matches!( 372 assert_debug_snapshot!(
373 do_reference_completion( 373 do_reference_completion(
374 r" 374 r"
375 struct Foo; 375 struct Foo;
@@ -401,7 +401,7 @@ mod tests {
401 401
402 #[test] 402 #[test]
403 fn completes_return_type() { 403 fn completes_return_type() {
404 assert_debug_snapshot_matches!( 404 assert_debug_snapshot!(
405 do_reference_completion( 405 do_reference_completion(
406 r" 406 r"
407 struct Foo; 407 struct Foo;
@@ -430,7 +430,7 @@ mod tests {
430 430
431 #[test] 431 #[test]
432 fn dont_show_both_completions_for_shadowing() { 432 fn dont_show_both_completions_for_shadowing() {
433 assert_debug_snapshot_matches!( 433 assert_debug_snapshot!(
434 do_reference_completion( 434 do_reference_completion(
435 r" 435 r"
436 fn foo() { 436 fn foo() {
@@ -465,7 +465,7 @@ mod tests {
465 465
466 #[test] 466 #[test]
467 fn completes_self_in_methods() { 467 fn completes_self_in_methods() {
468 assert_debug_snapshot_matches!( 468 assert_debug_snapshot!(
469 do_reference_completion(r"impl S { fn foo(&self) { <|> } }"), 469 do_reference_completion(r"impl S { fn foo(&self) { <|> } }"),
470 @r#"[ 470 @r#"[
471 CompletionItem { 471 CompletionItem {
@@ -489,7 +489,7 @@ mod tests {
489 489
490 #[test] 490 #[test]
491 fn completes_prelude() { 491 fn completes_prelude() {
492 assert_debug_snapshot_matches!( 492 assert_debug_snapshot!(
493 do_reference_completion( 493 do_reference_completion(
494 " 494 "
495 //- /main.rs 495 //- /main.rs
diff --git a/crates/ra_ide_api/src/completion/complete_snippet.rs b/crates/ra_ide_api/src/completion/complete_snippet.rs
index a35f31511..b06221c2a 100644
--- a/crates/ra_ide_api/src/completion/complete_snippet.rs
+++ b/crates/ra_ide_api/src/completion/complete_snippet.rs
@@ -40,7 +40,7 @@ fn ${1:feature}() {
40#[cfg(test)] 40#[cfg(test)]
41mod tests { 41mod tests {
42 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 42 use crate::completion::{do_completion, CompletionItem, CompletionKind};
43 use insta::assert_debug_snapshot_matches; 43 use insta::assert_debug_snapshot;
44 44
45 fn do_snippet_completion(code: &str) -> Vec<CompletionItem> { 45 fn do_snippet_completion(code: &str) -> Vec<CompletionItem> {
46 do_completion(code, CompletionKind::Snippet) 46 do_completion(code, CompletionKind::Snippet)
@@ -48,7 +48,7 @@ mod tests {
48 48
49 #[test] 49 #[test]
50 fn completes_snippets_in_expressions() { 50 fn completes_snippets_in_expressions() {
51 assert_debug_snapshot_matches!( 51 assert_debug_snapshot!(
52 do_snippet_completion(r"fn foo(x: i32) { <|> }"), 52 do_snippet_completion(r"fn foo(x: i32) { <|> }"),
53 @r#"[ 53 @r#"[
54 CompletionItem { 54 CompletionItem {
@@ -71,11 +71,11 @@ mod tests {
71 71
72 #[test] 72 #[test]
73 fn should_not_complete_snippets_in_path() { 73 fn should_not_complete_snippets_in_path() {
74 assert_debug_snapshot_matches!( 74 assert_debug_snapshot!(
75 do_snippet_completion(r"fn foo(x: i32) { ::foo<|> }"), 75 do_snippet_completion(r"fn foo(x: i32) { ::foo<|> }"),
76 @r#"[]"# 76 @r#"[]"#
77 ); 77 );
78 assert_debug_snapshot_matches!( 78 assert_debug_snapshot!(
79 do_snippet_completion(r"fn foo(x: i32) { ::<|> }"), 79 do_snippet_completion(r"fn foo(x: i32) { ::<|> }"),
80 @r#"[]"# 80 @r#"[]"#
81 ); 81 );
@@ -83,7 +83,7 @@ mod tests {
83 83
84 #[test] 84 #[test]
85 fn completes_snippets_in_items() { 85 fn completes_snippets_in_items() {
86 assert_debug_snapshot_matches!( 86 assert_debug_snapshot!(
87 do_snippet_completion( 87 do_snippet_completion(
88 r" 88 r"
89 #[cfg(test)] 89 #[cfg(test)]
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs
index 147ceda0c..f19eec9b7 100644
--- a/crates/ra_ide_api/src/completion/presentation.rs
+++ b/crates/ra_ide_api/src/completion/presentation.rs
@@ -186,7 +186,7 @@ impl Completions {
186#[cfg(test)] 186#[cfg(test)]
187mod tests { 187mod tests {
188 use crate::completion::{do_completion, CompletionItem, CompletionKind}; 188 use crate::completion::{do_completion, CompletionItem, CompletionKind};
189 use insta::assert_debug_snapshot_matches; 189 use insta::assert_debug_snapshot;
190 use test_utils::covers; 190 use test_utils::covers;
191 191
192 fn do_reference_completion(code: &str) -> Vec<CompletionItem> { 192 fn do_reference_completion(code: &str) -> Vec<CompletionItem> {
@@ -196,7 +196,7 @@ mod tests {
196 #[test] 196 #[test]
197 fn inserts_parens_for_function_calls() { 197 fn inserts_parens_for_function_calls() {
198 covers!(inserts_parens_for_function_calls); 198 covers!(inserts_parens_for_function_calls);
199 assert_debug_snapshot_matches!( 199 assert_debug_snapshot!(
200 do_reference_completion( 200 do_reference_completion(
201 r" 201 r"
202 fn no_args() {} 202 fn no_args() {}
@@ -222,7 +222,7 @@ mod tests {
222 }, 222 },
223]"### 223]"###
224 ); 224 );
225 assert_debug_snapshot_matches!( 225 assert_debug_snapshot!(
226 do_reference_completion( 226 do_reference_completion(
227 r" 227 r"
228 fn with_args(x: i32, y: String) {} 228 fn with_args(x: i32, y: String) {}
@@ -248,7 +248,7 @@ mod tests {
248 }, 248 },
249]"### 249]"###
250 ); 250 );
251 assert_debug_snapshot_matches!( 251 assert_debug_snapshot!(
252 do_reference_completion( 252 do_reference_completion(
253 r" 253 r"
254 struct S {} 254 struct S {}
@@ -275,7 +275,7 @@ mod tests {
275 275
276 #[test] 276 #[test]
277 fn dont_render_function_parens_in_use_item() { 277 fn dont_render_function_parens_in_use_item() {
278 assert_debug_snapshot_matches!( 278 assert_debug_snapshot!(
279 do_reference_completion( 279 do_reference_completion(
280 " 280 "
281 //- /lib.rs 281 //- /lib.rs
@@ -298,7 +298,7 @@ mod tests {
298 298
299 #[test] 299 #[test]
300 fn dont_render_function_parens_if_already_call() { 300 fn dont_render_function_parens_if_already_call() {
301 assert_debug_snapshot_matches!( 301 assert_debug_snapshot!(
302 do_reference_completion( 302 do_reference_completion(
303 " 303 "
304 //- /lib.rs 304 //- /lib.rs
@@ -327,7 +327,7 @@ mod tests {
327 }, 327 },
328]"# 328]"#
329 ); 329 );
330 assert_debug_snapshot_matches!( 330 assert_debug_snapshot!(
331 do_reference_completion( 331 do_reference_completion(
332 " 332 "
333 //- /lib.rs 333 //- /lib.rs