Auto-upgrade some insta snapshots

This commit is contained in:
Aleksey Kladov 2019-11-15 12:56:24 +03:00
parent e05fc9455d
commit 3564fbb7f5
17 changed files with 1643 additions and 1596 deletions

View file

@ -254,7 +254,6 @@ fn test(a: u32, b: isize, c: !, d: &str) {
1.0f32;
}"#),
@r###"
[9; 10) 'a': u32
[17; 18) 'b': isize
[27; 28) 'c': !
@ -317,7 +316,6 @@ fn test() {
}
"#),
@r###"
[15; 20) '{ 1 }': u32
[17; 18) '1': u32
[48; 53) '{ 1 }': u32
@ -409,7 +407,6 @@ fn test() {
}
"#),
@r###"
[72; 154) '{ ...a.c; }': ()
[82; 83) 'c': C
[86; 87) 'C': C(usize) -> C
@ -443,7 +440,6 @@ fn test() {
E::V2;
}"#),
@r###"
[48; 82) '{ E:...:V2; }': ()
[52; 70) 'E::V1 ...d: 1 }': E
[67; 68) '1': u32
@ -471,7 +467,6 @@ fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) {
}
"#),
@r###"
[9; 10) 'a': &u32
[18; 19) 'b': &mut u32
[31; 32) 'c': *const u32
@ -524,7 +519,6 @@ fn test() {
}
"##),
@r###"
[11; 221) '{ ...o"#; }': ()
[17; 21) '5i32': i32
[27; 31) '5f32': f32
@ -568,7 +562,6 @@ fn test(x: SomeType) {
}
"#),
@r###"
[27; 28) 'x': SomeType
[40; 272) '{ ...lo"; }': ()
[50; 51) 'b': bool
@ -632,7 +625,6 @@ fn test() -> &mut &f64 {
}
"#),
@r###"
[14; 15) 'x': u32
[22; 24) '{}': ()
[78; 231) '{ ...t &c }': &mut &f64
@ -679,7 +671,6 @@ impl S {
}
"#),
@r###"
[34; 38) 'self': &S
[40; 61) '{ ... }': ()
[50; 54) 'self': &S
@ -719,7 +710,6 @@ fn test() -> bool {
}
"#),
@r###"
[6; 7) 'x': bool
[22; 34) '{ 0i32 }': i32
[28; 32) '0i32': i32
@ -802,7 +792,6 @@ fn test2(a1: *const A, a2: *mut A) {
}
"#),
@r###"
[44; 45) 'a': A
[50; 213) '{ ...5.b; }': ()
[60; 62) 'a1': A
@ -983,7 +972,6 @@ fn test() {
}
"#),
@r###"
[11; 37) '{ l... {}; }': ()
[20; 21) 'x': ()
[24; 34) 'if true {}': ()
@ -1105,7 +1093,6 @@ fn test(a: A) {
}
"#),
@r###"
[32; 36) 'self': A
[38; 39) 'x': u32
[53; 55) '{}': ()
@ -1142,7 +1129,6 @@ fn test() {
}
"#),
@r###"
[40; 44) 'self': &str
[53; 55) '{}': ()
[69; 89) '{ ...o(); }': ()
@ -1166,7 +1152,6 @@ fn test(x: &str, y: isize) {
}
"#),
@r###"
[9; 10) 'x': &str
[18; 19) 'y': isize
[28; 170) '{ ...d"); }': ()
@ -1367,7 +1352,6 @@ fn test() {
}
"#),
@r###"
[28; 79) '{ ...(1); }': ()
[38; 42) 'A(n)': A<i32>
[40; 41) 'n': &i32
@ -1396,7 +1380,6 @@ fn test() {
}
"#),
@r###"
[11; 57) '{ ...= v; }': ()
[21; 22) 'v': &(i32, &i32)
[25; 33) '&(1, &2)': &(i32, &i32)
@ -1441,7 +1424,6 @@ fn test() {
}
"#),
@r###"
[68; 289) '{ ... d; }': ()
[78; 79) 'e': E
[82; 95) 'E::A { x: 3 }': E
@ -1488,7 +1470,6 @@ fn test(a1: A<u32>, i: i32) {
}
"#),
@r###"
[36; 38) 'a1': A<u32>
[48; 49) 'i': i32
[56; 147) '{ ...3.x; }': ()
@ -1569,7 +1550,6 @@ fn test(a1: A<u32>, o: Option<u64>) {
}
"#),
@r###"
[79; 81) 'a1': A<u32>
[91; 92) 'o': Option<u64>
[107; 244) '{ ... }; }': ()
@ -1604,7 +1584,6 @@ fn test() {
}
"#),
@r###"
[10; 11) 't': T
[21; 26) '{ t }': T
[23; 24) 't': T
@ -1652,7 +1631,6 @@ fn test() -> i128 {
}
"#),
@r###"
[74; 78) 'self': A<X, Y>
[85; 107) '{ ... }': X
[95; 99) 'self': A<X, Y>
@ -1706,7 +1684,6 @@ fn test(o: Option<u32>) {
}
"#),
@r###"
[78; 82) 'self': &Option<T>
[98; 100) '{}': ()
[111; 112) 'o': Option<u32>
@ -1744,7 +1721,6 @@ fn test() -> i128 {
}
"#),
@r###"
[53; 57) 'self': A<T2>
[65; 87) '{ ... }': T2
[75; 79) 'self': A<T2>
@ -1921,7 +1897,6 @@ fn test() {
}
"#),
@r###"
[56; 64) '{ A {} }': A
[58; 62) 'A {}': A
[126; 132) '{ 99 }': u32
@ -1961,7 +1936,6 @@ fn test() {
}
"#),
@r###"
[64; 67) 'val': T
[82; 109) '{ ... }': Gen<T>
[92; 103) 'Gen { val }': Gen<T>
@ -2129,7 +2103,6 @@ fn test(x: X) {
}
"#),
@r###"
[20; 21) 'x': X
[26; 47) '{ ...eld; }': ()
[32; 33) 'x': X
@ -2151,7 +2124,6 @@ fn test() {
}
"#),
@r###"
[11; 89) '{ ... } }': ()
[17; 21) 'X {}': {unknown}
[27; 87) 'match ... }': ()
@ -2174,7 +2146,6 @@ fn quux() {
}
"#),
@r###"
[11; 41) '{ ...+ y; }': ()
[21; 22) 'y': i32
[25; 27) '92': i32
@ -2300,7 +2271,6 @@ fn write() {
}
"#),
@r###"
[54; 139) '{ ... } }': ()
[60; 137) 'match ... }': ()
[66; 83) 'someth...nknown': Maybe<{unknown}>
@ -2322,7 +2292,6 @@ fn test_line_buffer() {
}
"#),
@r###"
[23; 53) '{ ...n']; }': ()
[29; 50) '&[0, b...b'\n']': &[u8;_]
[30; 50) '[0, b'...b'\n']': [u8;_]
@ -2446,7 +2415,6 @@ fn test<R>(query_response: Canonical<QueryResponse<R>>) {
}
"#),
@r###"
[92; 106) 'query_response': Canonical<QueryResponse<R>>
[137; 167) '{ ...lue; }': ()
[143; 164) '&query....value': &QueryResponse<R>
@ -2472,7 +2440,6 @@ pub fn main_loop() {
}
"#),
@r###"
[144; 146) '{}': ()
[169; 198) '{ ...t(); }': ()
[175; 193) 'FxHash...efault': fn default<{unknown}, FxHasher>() -> HashSet<T, H>
@ -2518,7 +2485,6 @@ fn test() {
}
"#),
@r###"
[49; 50) '0': u32
[80; 83) '101': u32
[95; 213) '{ ...NST; }': ()
@ -2549,7 +2515,6 @@ fn test() {
}
"#),
@r###"
[29; 32) '101': u32
[70; 73) '101': u32
[85; 280) '{ ...MUT; }': ()
@ -2588,7 +2553,6 @@ fn test() {
}
"#),
@r###"
[31; 35) 'self': &Self
[110; 114) 'self': &Self
[170; 228) '{ ...i128 }': ()
@ -2636,7 +2600,6 @@ mod bar_test {
}
"#),
@r###"
[63; 67) 'self': &Self
[169; 173) 'self': &Self
[300; 337) '{ ... }': ()
@ -2664,7 +2627,6 @@ fn test() {
}
"#),
@r###"
[33; 37) 'self': &Self
[92; 111) '{ ...d(); }': ()
[98; 99) 'S': S
@ -2694,7 +2656,6 @@ fn test() {
}
"#),
@r###"
[43; 47) 'self': &Self
[82; 86) 'self': &Self
[210; 361) '{ ..., i8 }': ()
@ -2725,7 +2686,6 @@ fn test() {
}
"#),
@r###"
[33; 37) 'self': &Self
[102; 127) '{ ...d(); }': ()
[108; 109) 'S': S<u32>(T) -> S<T>
@ -3130,7 +3090,6 @@ fn test<T: Iterable<Item=u32>>() {
}
"#),
@r###"
[67; 100) '{ ...own; }': ()
[77; 78) 'y': {unknown}
[90; 97) 'unknown': {unknown}
@ -3146,7 +3105,6 @@ const A: u32 = 1 + 1;
static B: u64 = { let x = 1; x };
"#),
@r###"
[16; 17) '1': u32
[16; 21) '1 + 1': u32
[20; 21) '1': u32
@ -3170,7 +3128,6 @@ fn test() -> u64 {
}
"#),
@r###"
[38; 87) '{ ... a.1 }': u64
[48; 49) 'a': S
[52; 53) 'S': S(i32, u64) -> S
@ -3225,7 +3182,6 @@ fn indexing_arrays() {
assert_snapshot!(
infer("fn main() { &mut [9][2]; }"),
@r###"
[10; 26) '{ &mut...[2]; }': ()
[12; 23) '&mut [9][2]': &mut {unknown}
[17; 20) '[9]': [i32;_]

View file

@ -88,16 +88,16 @@ mod tests {
",
),
@r###"
[
CompletionItem {
label: "the_field",
source_range: [94; 94),
delete: [94; 94),
insert: "the_field",
kind: Field,
detail: "u32",
},
]
[
CompletionItem {
label: "the_field",
source_range: [94; 94),
delete: [94; 94),
insert: "the_field",
kind: Field,
detail: "u32",
},
]
"###
);
}
@ -349,24 +349,24 @@ mod tests {
",
),
@r###"
[
CompletionItem {
label: "0",
source_range: [75; 75),
delete: [75; 75),
insert: "0",
kind: Field,
detail: "i32",
},
CompletionItem {
label: "1",
source_range: [75; 75),
delete: [75; 75),
insert: "1",
kind: Field,
detail: "f64",
},
]
[
CompletionItem {
label: "0",
source_range: [75; 75),
delete: [75; 75),
insert: "0",
kind: Field,
detail: "i32",
},
CompletionItem {
label: "1",
source_range: [75; 75),
delete: [75; 75),
insert: "1",
kind: Field,
detail: "f64",
},
]
"###
);
}
@ -419,16 +419,16 @@ mod tests {
",
),
@r###"
[
CompletionItem {
label: "the_field",
source_range: [106; 106),
delete: [106; 106),
insert: "the_field",
kind: Field,
detail: "u32",
},
]
[
CompletionItem {
label: "the_field",
source_range: [106; 106),
delete: [106; 106),
insert: "the_field",
kind: Field,
detail: "u32",
},
]
"###
);
}
@ -452,15 +452,15 @@ mod tests {
}
"###, CompletionKind::Keyword),
@r###"
[
CompletionItem {
label: "await",
source_range: [74; 74),
delete: [74; 74),
insert: "await",
detail: "expr.await",
},
]
[
CompletionItem {
label: "await",
source_range: [74; 74),
delete: [74; 74),
insert: "await",
detail: "expr.await",
},
]
"###
)
}

View file

@ -70,15 +70,15 @@ mod tests {
",
),
@r###"
[
CompletionItem {
label: "file_id: FileId",
source_range: [110; 114),
delete: [110; 114),
insert: "file_id: FileId",
lookup: "file_id",
},
]
[
CompletionItem {
label: "file_id: FileId",
source_range: [110; 114),
delete: [110; 114),
insert: "file_id: FileId",
lookup: "file_id",
},
]
"###
);
}
@ -94,15 +94,15 @@ mod tests {
",
),
@r###"
[
CompletionItem {
label: "file_id: FileId",
source_range: [110; 114),
delete: [110; 114),
insert: "file_id: FileId",
lookup: "file_id",
},
]
[
CompletionItem {
label: "file_id: FileId",
source_range: [110; 114),
delete: [110; 114),
insert: "file_id: FileId",
lookup: "file_id",
},
]
"###
);
}
@ -121,15 +121,15 @@ mod tests {
",
),
@r###"
[
CompletionItem {
label: "file_id: FileId",
source_range: [289; 293),
delete: [289; 293),
insert: "file_id: FileId",
lookup: "file_id",
},
]
[
CompletionItem {
label: "file_id: FileId",
source_range: [289; 293),
delete: [289; 293),
insert: "file_id: FileId",
lookup: "file_id",
},
]
"###
);
}

View file

@ -131,7 +131,8 @@ mod tests {
use <|>
",
),
@r###"[
@r###"
[
CompletionItem {
label: "crate",
source_range: [21; 21),
@ -153,7 +154,8 @@ mod tests {
insert: "super::",
kind: Keyword,
},
]"###
]
"###
);
assert_debug_snapshot!(
@ -162,7 +164,8 @@ mod tests {
use a::<|>
",
),
@r###"[
@r###"
[
CompletionItem {
label: "self",
source_range: [24; 24),
@ -177,7 +180,8 @@ mod tests {
insert: "super::",
kind: Keyword,
},
]"###
]
"###
);
assert_debug_snapshot!(
@ -186,7 +190,8 @@ mod tests {
use a::{b, <|>}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "self",
source_range: [28; 28),
@ -201,7 +206,8 @@ mod tests {
insert: "super::",
kind: Keyword,
},
]"###
]
"###
);
}
@ -215,7 +221,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "if",
source_range: [49; 49),
@ -251,7 +258,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
}
@ -267,7 +275,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "else",
source_range: [108; 108),
@ -317,7 +326,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
}
@ -332,7 +342,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "if",
source_range: [56; 56),
@ -368,7 +379,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
assert_debug_snapshot!(
do_keyword_completion(
@ -379,7 +391,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "if",
source_range: [49; 49),
@ -415,7 +428,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
}
@ -431,7 +445,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "if",
source_range: [97; 97),
@ -467,7 +482,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
}
@ -483,7 +499,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "if",
source_range: [95; 95),
@ -519,7 +536,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
assert_debug_snapshot!(
do_keyword_completion(
@ -533,7 +551,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "if",
source_range: [95; 95),
@ -569,7 +588,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
}
@ -583,7 +603,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "break",
source_range: [63; 63),
@ -633,7 +654,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
// No completion: lambda isolates control flow
@ -645,7 +667,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "if",
source_range: [68; 68),
@ -681,7 +704,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
);
}
@ -699,7 +723,8 @@ mod tests {
}
",
),
@r###"[
@r###"
[
CompletionItem {
label: "break",
source_range: [122; 124),
@ -749,7 +774,8 @@ mod tests {
insert: "while $0 {}",
kind: Keyword,
},
]"###
]
"###
)
}
}

View file

@ -37,7 +37,8 @@ mod tests {
<|>
"
),
@r##"[
@r###"
[
CompletionItem {
label: "foo!",
source_range: [46; 46),
@ -46,7 +47,8 @@ mod tests {
kind: Macro,
detail: "macro_rules! foo",
},
]"##
]
"###
);
}
@ -75,7 +77,8 @@ mod tests {
<|>
"
),
@r##"[
@r###"
[
CompletionItem {
label: "vec!",
source_range: [280; 280),
@ -87,7 +90,8 @@ mod tests {
"Creates a [`Vec`] containing the arguments.\n\n- Create a [`Vec`] containing a given list of elements:\n\n```\nlet v = vec![1, 2, 3];\nassert_eq!(v[0], 1);\nassert_eq!(v[1], 2);\nassert_eq!(v[2], 3);\n```",
),
},
]"##
]
"###
);
}
@ -110,7 +114,8 @@ mod tests {
}
"
),
@r###"[
@r###"
[
CompletionItem {
label: "foo!",
source_range: [163; 163),

View file

@ -152,7 +152,8 @@ mod tests {
}
"
),
@r###"[
@r###"
[
CompletionItem {
label: "my",
source_range: [27; 29),
@ -163,7 +164,8 @@ mod tests {
"Some simple\ndocs describing `mod my`.",
),
},
]"###
]
"###
);
}
@ -179,7 +181,8 @@ mod tests {
}
"
),
@r###"[
@r###"
[
CompletionItem {
label: "Bar",
source_range: [30; 30),
@ -187,7 +190,8 @@ mod tests {
insert: "Bar",
kind: Struct,
},
]"###
]
"###
);
}
@ -203,7 +207,8 @@ mod tests {
use crate::Sp<|>
"
),
@r###"[
@r###"
[
CompletionItem {
label: "Spam",
source_range: [11; 13),
@ -218,7 +223,8 @@ mod tests {
insert: "foo",
kind: Module,
},
]"###
]
"###
);
}
@ -234,7 +240,8 @@ mod tests {
use crate::{Sp<|>};
"
),
@r###"[
@r###"
[
CompletionItem {
label: "Spam",
source_range: [12; 14),
@ -249,7 +256,8 @@ mod tests {
insert: "foo",
kind: Module,
},
]"###
]
"###
);
}
@ -269,7 +277,8 @@ mod tests {
use crate::{bar::{baz::Sp<|>}};
"
),
@r###"[
@r###"
[
CompletionItem {
label: "Spam",
source_range: [23; 25),
@ -277,7 +286,8 @@ mod tests {
insert: "Spam",
kind: Struct,
},
]"###
]
"###
);
}
@ -297,7 +307,8 @@ mod tests {
fn foo() { let _ = E::<|> }
"
),
@r###"[
@r###"
[
CompletionItem {
label: "Bar",
source_range: [116; 116),
@ -320,7 +331,8 @@ mod tests {
"Foo Variant",
),
},
]"###
]
"###
);
}
@ -343,7 +355,8 @@ mod tests {
fn foo() { let _ = E::<|> }
"
),
@r###"[
@r###"
[
CompletionItem {
label: "Bar",
source_range: [180; 180),
@ -377,7 +390,8 @@ mod tests {
"",
),
},
]"###
]
"###
);
}
@ -434,7 +448,8 @@ mod tests {
fn foo() { let _ = S::<|> }
"
),
@r###"[
@r###"
[
CompletionItem {
label: "C",
source_range: [107; 107),
@ -446,7 +461,8 @@ mod tests {
"An associated const",
),
},
]"###
]
"###
);
}
@ -467,7 +483,8 @@ mod tests {
fn foo() { let _ = S::<|> }
"
),
@r###"[
@r###"
[
CompletionItem {
label: "T",
source_range: [101; 101),
@ -479,7 +496,8 @@ mod tests {
"An associated type",
),
},
]"###
]
"###
);
}
@ -569,7 +587,8 @@ mod tests {
}
"
),
@r###"[
@r###"
[
CompletionItem {
label: "bar",
source_range: [9; 9),
@ -577,7 +596,8 @@ mod tests {
insert: "bar",
kind: Module,
},
]"###
]
"###
);
}

View file

@ -54,36 +54,36 @@ mod tests {
",
);
assert_debug_snapshot!(completions, @r###"
[
CompletionItem {
label: "E",
source_range: [246; 246),
delete: [246; 246),
insert: "E",
kind: Enum,
},
CompletionItem {
label: "X",
source_range: [246; 246),
delete: [246; 246),
insert: "X",
kind: EnumVariant,
},
CompletionItem {
label: "Z",
source_range: [246; 246),
delete: [246; 246),
insert: "Z",
kind: Const,
},
CompletionItem {
label: "m",
source_range: [246; 246),
delete: [246; 246),
insert: "m",
kind: Module,
},
]
[
CompletionItem {
label: "E",
source_range: [246; 246),
delete: [246; 246),
insert: "E",
kind: Enum,
},
CompletionItem {
label: "X",
source_range: [246; 246),
delete: [246; 246),
insert: "X",
kind: EnumVariant,
},
CompletionItem {
label: "Z",
source_range: [246; 246),
delete: [246; 246),
insert: "Z",
kind: Const,
},
CompletionItem {
label: "m",
source_range: [246; 246),
delete: [246; 246),
insert: "m",
kind: Module,
},
]
"###);
}
}

View file

@ -104,7 +104,8 @@ mod tests {
}
"#,
),
@r###"[
@r###"
[
CompletionItem {
label: "box",
source_range: [89; 89),
@ -161,7 +162,8 @@ mod tests {
insert: "while bar {\n$0\n}",
detail: "while expr {}",
},
]"###
]
"###
);
}
@ -176,7 +178,8 @@ mod tests {
}
"#,
),
@r###"[
@r###"
[
CompletionItem {
label: "box",
source_range: [91; 91),
@ -219,7 +222,8 @@ mod tests {
insert: "&mut bar",
detail: "&mut expr",
},
]"###
]
"###
);
}
@ -233,7 +237,8 @@ mod tests {
}
"#,
),
@r###"[
@r###"
[
CompletionItem {
label: "box",
source_range: [52; 52),
@ -276,7 +281,8 @@ mod tests {
insert: "&mut 42",
detail: "&mut expr",
},
]"###
]
"###
);
}
}

View file

@ -45,17 +45,17 @@ mod tests {
",
);
assert_debug_snapshot!(completions, @r###"
[
CompletionItem {
label: "the_field",
source_range: [142; 145),
delete: [142; 145),
insert: "the_field",
kind: Field,
detail: "u32",
deprecated: true,
},
]
[
CompletionItem {
label: "the_field",
source_range: [142; 145),
delete: [142; 145),
insert: "the_field",
kind: Field,
detail: "u32",
deprecated: true,
},
]
"###);
}
@ -70,16 +70,16 @@ mod tests {
",
);
assert_debug_snapshot!(completions, @r###"
[
CompletionItem {
label: "the_field",
source_range: [83; 86),
delete: [83; 86),
insert: "the_field",
kind: Field,
detail: "u32",
},
]
[
CompletionItem {
label: "the_field",
source_range: [83; 86),
delete: [83; 86),
insert: "the_field",
kind: Field,
detail: "u32",
},
]
"###);
}
@ -96,16 +96,16 @@ mod tests {
",
);
assert_debug_snapshot!(completions, @r###"
[
CompletionItem {
label: "a",
source_range: [119; 119),
delete: [119; 119),
insert: "a",
kind: Field,
detail: "u32",
},
]
[
CompletionItem {
label: "a",
source_range: [119; 119),
delete: [119; 119),
insert: "a",
kind: Field,
detail: "u32",
},
]
"###);
}
@ -122,16 +122,16 @@ mod tests {
",
);
assert_debug_snapshot!(completions, @r###"
[
CompletionItem {
label: "b",
source_range: [119; 119),
delete: [119; 119),
insert: "b",
kind: Field,
detail: "u32",
},
]
[
CompletionItem {
label: "b",
source_range: [119; 119),
delete: [119; 119),
insert: "b",
kind: Field,
detail: "u32",
},
]
"###);
}
@ -147,16 +147,16 @@ mod tests {
",
);
assert_debug_snapshot!(completions, @r###"
[
CompletionItem {
label: "a",
source_range: [93; 93),
delete: [93; 93),
insert: "a",
kind: Field,
detail: "u32",
},
]
[
CompletionItem {
label: "a",
source_range: [93; 93),
delete: [93; 93),
insert: "a",
kind: Field,
detail: "u32",
},
]
"###);
}
}

View file

@ -44,16 +44,16 @@ mod tests {
",
);
assert_debug_snapshot!(completions, @r###"
[
CompletionItem {
label: "foo",
source_range: [117; 118),
delete: [117; 118),
insert: "foo",
kind: Field,
detail: "u32",
},
]
[
CompletionItem {
label: "foo",
source_range: [117; 118),
delete: [117; 118),
insert: "foo",
kind: Field,
detail: "u32",
},
]
"###);
}
@ -73,24 +73,24 @@ mod tests {
",
);
assert_debug_snapshot!(completions, @r###"
[
CompletionItem {
label: "bar",
source_range: [161; 161),
delete: [161; 161),
insert: "bar",
kind: Field,
detail: "()",
},
CompletionItem {
label: "foo",
source_range: [161; 161),
delete: [161; 161),
insert: "foo",
kind: Field,
detail: "u32",
},
]
[
CompletionItem {
label: "bar",
source_range: [161; 161),
delete: [161; 161),
insert: "bar",
kind: Field,
detail: "()",
},
CompletionItem {
label: "foo",
source_range: [161; 161),
delete: [161; 161),
insert: "foo",
kind: Field,
detail: "u32",
},
]
"###);
}
}

View file

@ -409,7 +409,8 @@ mod tests {
// nothing here
"
),
@r#"[
@r###"
[
CompletionItem {
label: "other_crate",
source_range: [4; 4),
@ -417,7 +418,8 @@ mod tests {
insert: "other_crate",
kind: Module,
},
]"#
]
"###
);
}
@ -530,7 +532,8 @@ mod tests {
fn completes_self_in_methods() {
assert_debug_snapshot!(
do_reference_completion(r"impl S { fn foo(&self) { <|> } }"),
@r#"[
@r###"
[
CompletionItem {
label: "Self",
source_range: [25; 25),
@ -546,7 +549,8 @@ mod tests {
kind: Binding,
detail: "&{unknown}",
},
]"#
]
"###
);
}

View file

@ -52,7 +52,8 @@ mod tests {
fn completes_snippets_in_expressions() {
assert_debug_snapshot!(
do_snippet_completion(r"fn foo(x: i32) { <|> }"),
@r#"[
@r###"
[
CompletionItem {
label: "pd",
source_range: [17; 17),
@ -67,7 +68,8 @@ mod tests {
insert: "eprintln!(\"$0 = {:#?}\", $0);",
kind: Snippet,
},
]"#
]
"###
);
}
@ -75,11 +77,11 @@ mod tests {
fn should_not_complete_snippets_in_path() {
assert_debug_snapshot!(
do_snippet_completion(r"fn foo(x: i32) { ::foo<|> }"),
@r#"[]"#
@"[]"
);
assert_debug_snapshot!(
do_snippet_completion(r"fn foo(x: i32) { ::<|> }"),
@r#"[]"#
@"[]"
);
}
@ -94,7 +96,8 @@ mod tests {
}
"
),
@r###"[
@r###"
[
CompletionItem {
label: "Test function",
source_range: [78; 78),
@ -110,7 +113,8 @@ mod tests {
insert: "pub(crate) $0",
kind: Snippet,
},
]"###
]
"###
);
}
}

View file

@ -459,7 +459,8 @@ mod tests {
use crate::m::f<|>;
"
),
@r#"[
@r###"
[
CompletionItem {
label: "foo",
source_range: [40; 41),
@ -468,7 +469,8 @@ mod tests {
kind: Function,
detail: "pub fn foo()",
},
]"#
]
"###
);
}
@ -484,7 +486,8 @@ mod tests {
}
"
),
@r#"[
@r###"
[
CompletionItem {
label: "frobnicate",
source_range: [35; 39),
@ -501,7 +504,8 @@ mod tests {
kind: Function,
detail: "fn main()",
},
]"#
]
"###
);
assert_debug_snapshot!(
do_reference_completion(
@ -514,7 +518,8 @@ mod tests {
}
"
),
@r#"[
@r###"
[
CompletionItem {
label: "new",
source_range: [67; 69),
@ -523,7 +528,8 @@ mod tests {
kind: Function,
detail: "fn new() -> Foo",
},
]"#
]
"###
);
}

View file

@ -526,28 +526,28 @@ mod tests {
let (analysis, file_id) = single_file("mod foo;");
let diagnostics = analysis.diagnostics(file_id).unwrap();
assert_debug_snapshot!(diagnostics, @r###"
[
Diagnostic {
message: "unresolved module",
range: [0; 8),
fix: Some(
SourceChange {
label: "create module",
source_file_edits: [],
file_system_edits: [
CreateFile {
source_root: SourceRootId(
0,
),
path: "foo.rs",
},
],
cursor_position: None,
},
),
severity: Error,
},
]
[
Diagnostic {
message: "unresolved module",
range: [0; 8),
fix: Some(
SourceChange {
label: "create module",
source_file_edits: [],
file_system_edits: [
CreateFile {
source_root: SourceRootId(
0,
),
path: "foo.rs",
},
],
cursor_position: None,
},
),
severity: Error,
},
]
"###);
}

View file

@ -209,7 +209,8 @@ fn very_obsolete() {}
.unwrap();
let structure = file_structure(&file);
assert_debug_snapshot!(structure,
@r#"[
@r###"
[
StructureNode {
parent: None,
label: "Foo",
@ -393,7 +394,8 @@ fn very_obsolete() {}
),
deprecated: true,
},
]"#
]
"###
);
}
}

View file

@ -214,7 +214,8 @@ fn main() {
}"#,
);
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r#"[
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r###"
[
InlayHint {
range: [193; 197),
kind: TypeHint,
@ -265,7 +266,8 @@ fn main() {
kind: TypeHint,
label: "f64",
},
]"#
]
"###
);
}
@ -281,7 +283,8 @@ fn main() {
}"#,
);
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r#"[
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r###"
[
InlayHint {
range: [21; 30),
kind: TypeHint,
@ -292,7 +295,8 @@ fn main() {
kind: TypeHint,
label: "i32",
},
]"#
]
"###
);
}
@ -308,7 +312,8 @@ fn main() {
}"#,
);
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r#"[
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r###"
[
InlayHint {
range: [21; 30),
kind: TypeHint,
@ -319,7 +324,8 @@ fn main() {
kind: TypeHint,
label: "i32",
},
]"#
]
"###
);
}
@ -354,7 +360,8 @@ fn main() {
}"#,
);
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r#"[
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r###"
[
InlayHint {
range: [166; 170),
kind: TypeHint,
@ -380,7 +387,8 @@ fn main() {
kind: TypeHint,
label: "&u32",
},
]"#
]
"###
);
}
@ -416,33 +424,33 @@ fn main() {
);
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r###"
[
InlayHint {
range: [166; 170),
kind: TypeHint,
label: "CustomOption<Test>",
},
InlayHint {
range: [343; 347),
kind: TypeHint,
label: "&Test",
},
InlayHint {
range: [401; 402),
kind: TypeHint,
label: "&CustomOption<u32>",
},
InlayHint {
range: [404; 405),
kind: TypeHint,
label: "&u8",
},
InlayHint {
range: [549; 550),
kind: TypeHint,
label: "&u32",
},
]
[
InlayHint {
range: [166; 170),
kind: TypeHint,
label: "CustomOption<Test>",
},
InlayHint {
range: [343; 347),
kind: TypeHint,
label: "&Test",
},
InlayHint {
range: [401; 402),
kind: TypeHint,
label: "&CustomOption<u32>",
},
InlayHint {
range: [404; 405),
kind: TypeHint,
label: "&u8",
},
InlayHint {
range: [549; 550),
kind: TypeHint,
label: "&u32",
},
]
"###
);
}
@ -478,7 +486,8 @@ fn main() {
}"#,
);
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r#"[
assert_debug_snapshot!(analysis.inlay_hints(file_id).unwrap(), @r###"
[
InlayHint {
range: [311; 315),
kind: TypeHint,
@ -499,7 +508,8 @@ fn main() {
kind: TypeHint,
label: "u32",
},
]"#
]
"###
);
}
}

View file

@ -97,7 +97,8 @@ mod tests {
);
let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot!(&runnables,
@r#"[
@r###"
[
Runnable {
range: [1; 21),
kind: Bin,
@ -114,7 +115,8 @@ mod tests {
name: "test_foo",
},
},
]"#
]
"###
);
}
@ -132,7 +134,8 @@ mod tests {
);
let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot!(&runnables,
@r#"[
@r###"
[
Runnable {
range: [1; 59),
kind: TestMod {
@ -145,7 +148,8 @@ mod tests {
name: "test_foo1",
},
},
]"#
]
"###
);
}
@ -165,7 +169,8 @@ mod tests {
);
let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot!(&runnables,
@r#"[
@r###"
[
Runnable {
range: [23; 85),
kind: TestMod {
@ -178,7 +183,8 @@ mod tests {
name: "test_foo1",
},
},
]"#
]
"###
);
}
@ -200,7 +206,8 @@ mod tests {
);
let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot!(&runnables,
@r#"[
@r###"
[
Runnable {
range: [41; 115),
kind: TestMod {
@ -213,7 +220,8 @@ mod tests {
name: "test_foo1",
},
},
]"#
]
"###
);
}