Skip to content

Commit 20bc753

Browse files
authored
Merge pull request rust-lang#18713 from Veykril/push-zmmkzspnwxsn
internal: Cleanup label structure of `CompletionItem`
2 parents 88be63a + 5105513 commit 20bc753

File tree

23 files changed

+1201
-1070
lines changed

23 files changed

+1201
-1070
lines changed

Diff for: src/tools/rust-analyzer/crates/ide-completion/src/completions/dot.rs

+25-25
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl S {
205205
fn foo(s: S) { s.$0 }
206206
"#,
207207
expect![[r#"
208-
fd foo u32
208+
fd foo u32
209209
me bar() fn(&self)
210210
"#]],
211211
);
@@ -259,7 +259,7 @@ impl S {
259259
"#,
260260
expect![[r#"
261261
fd the_field (u32,)
262-
me foo() fn(self)
262+
me foo() fn(self)
263263
"#]],
264264
)
265265
}
@@ -275,7 +275,7 @@ impl A {
275275
"#,
276276
expect![[r#"
277277
fd the_field (u32, i32)
278-
me foo() fn(&self)
278+
me foo() fn(&self)
279279
"#]],
280280
)
281281
}
@@ -536,7 +536,7 @@ impl A {
536536
}
537537
"#,
538538
expect![[r#"
539-
fd pub_field u32
539+
fd pub_field u32
540540
me pub_method() fn(&self)
541541
"#]],
542542
)
@@ -550,7 +550,7 @@ union U { field: u8, other: u16 }
550550
fn foo(u: U) { u.$0 }
551551
"#,
552552
expect![[r#"
553-
fd field u8
553+
fd field u8
554554
fd other u16
555555
"#]],
556556
);
@@ -725,8 +725,8 @@ fn test(a: A) {
725725
}
726726
"#,
727727
expect![[r#"
728-
fd another u32
729-
fd field u8
728+
fd another u32
729+
fd field u8
730730
me deref() (use core::ops::Deref) fn(&self) -> &<Self as Deref>::Target
731731
"#]],
732732
);
@@ -748,8 +748,8 @@ fn test(a: A) {
748748
}
749749
"#,
750750
expect![[r#"
751-
fd 0 u8
752-
fd 1 u32
751+
fd 0 u8
752+
fd 1 u32
753753
me deref() (use core::ops::Deref) fn(&self) -> &<Self as Deref>::Target
754754
"#]],
755755
);
@@ -770,8 +770,8 @@ fn test(a: A) {
770770
}
771771
"#,
772772
expect![[r#"
773-
fd 0 u8
774-
fd 1 u32
773+
fd 0 u8
774+
fd 1 u32
775775
me deref() (use core::ops::Deref) fn(&self) -> &<Self as Deref>::Target
776776
"#]],
777777
);
@@ -964,12 +964,12 @@ struct Foo { field: i32 }
964964
965965
impl Foo { fn foo(&self) { $0 } }"#,
966966
expect![[r#"
967-
fd self.field i32
967+
fd self.field i32
968968
me self.foo() fn(&self)
969-
lc self &Foo
970-
sp Self Foo
971-
st Foo Foo
972-
bt u32 u32
969+
lc self &Foo
970+
sp Self Foo
971+
st Foo Foo
972+
bt u32 u32
973973
"#]],
974974
);
975975
check(
@@ -978,12 +978,12 @@ struct Foo(i32);
978978
979979
impl Foo { fn foo(&mut self) { $0 } }"#,
980980
expect![[r#"
981-
fd self.0 i32
981+
fd self.0 i32
982982
me self.foo() fn(&mut self)
983-
lc self &mut Foo
984-
sp Self Foo
985-
st Foo Foo
986-
bt u32 u32
983+
lc self &mut Foo
984+
sp Self Foo
985+
st Foo Foo
986+
bt u32 u32
987987
"#]],
988988
);
989989
}
@@ -1106,7 +1106,7 @@ fn test(a: A) {
11061106
}
11071107
"#,
11081108
expect![[r#"
1109-
fd 0 u8
1109+
fd 0 u8
11101110
me deref() (use core::ops::Deref) fn(&self) -> &<Self as Deref>::Target
11111111
"#]],
11121112
);
@@ -1162,7 +1162,7 @@ impl<F: core::ops::Deref<Target = impl Bar>> Foo<F> {
11621162
}
11631163
"#,
11641164
expect![[r#"
1165-
fd foo &u8
1165+
fd foo &u8
11661166
me foobar() fn(&self)
11671167
"#]],
11681168
);
@@ -1199,8 +1199,8 @@ impl<B: Bar, F: core::ops::Deref<Target = B>> Foo<F> {
11991199
}
12001200
"#,
12011201
expect![[r#"
1202-
fd foo &u8
1203-
"#]],
1202+
fd foo &u8
1203+
"#]],
12041204
);
12051205
}
12061206

Diff for: src/tools/rust-analyzer/crates/ide-completion/src/completions/item_list/trait_impl.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,10 @@ impl Test for T {
537537
}
538538
",
539539
expect![[r#"
540-
sp Self T
541-
st T T
540+
sp Self T
541+
st T T
542542
tt Test
543-
bt u32 u32
543+
bt u32 u32
544544
"#]],
545545
);
546546

@@ -646,10 +646,10 @@ impl Test for T {
646646
}
647647
",
648648
expect![[r#"
649-
sp Self T
650-
st T T
649+
sp Self T
650+
st T T
651651
tt Test
652-
bt u32 u32
652+
bt u32 u32
653653
"#]],
654654
);
655655

@@ -663,10 +663,10 @@ impl Test for T {
663663
}
664664
",
665665
expect![[r#"
666-
sp Self T
667-
st T T
666+
sp Self T
667+
st T T
668668
tt Test
669-
bt u32 u32
669+
bt u32 u32
670670
"#]],
671671
);
672672

@@ -682,10 +682,10 @@ impl Test for T {
682682
}
683683
",
684684
expect![[r#"
685-
sp Self T
686-
st T T
685+
sp Self T
686+
st T T
687687
tt Test
688-
bt u32 u32
688+
bt u32 u32
689689
"#]],
690690
);
691691

@@ -730,10 +730,10 @@ impl Test for T {
730730
}
731731
",
732732
expect![[r#"
733-
sp Self T
734-
st T T
733+
sp Self T
734+
st T T
735735
tt Test
736-
bt u32 u32
736+
bt u32 u32
737737
"#]],
738738
);
739739

Diff for: src/tools/rust-analyzer/crates/ide-completion/src/completions/keyword.rs

+39-39
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ fn foo(a: A) { a.$0 }
7878
"#,
7979
expect![[r#"
8080
me into_future() (as IntoFuture) fn(self) -> <Self as IntoFuture>::IntoFuture
81-
kw await expr.await
82-
sn box Box::new(expr)
83-
sn call function(expr)
84-
sn dbg dbg!(expr)
85-
sn dbgr dbg!(&expr)
86-
sn deref *expr
87-
sn let let
88-
sn letm let mut
89-
sn match match expr {}
90-
sn ref &expr
91-
sn refm &mut expr
92-
sn return return expr
93-
sn unsafe unsafe {}
81+
kw await expr.await
82+
sn box Box::new(expr)
83+
sn call function(expr)
84+
sn dbg dbg!(expr)
85+
sn dbgr dbg!(&expr)
86+
sn deref *expr
87+
sn let let
88+
sn letm let mut
89+
sn match match expr {}
90+
sn ref &expr
91+
sn refm &mut expr
92+
sn return return expr
93+
sn unsafe unsafe {}
9494
"#]],
9595
);
9696

@@ -105,19 +105,19 @@ fn foo() {
105105
"#,
106106
expect![[r#"
107107
me into_future() (use core::future::IntoFuture) fn(self) -> <Self as IntoFuture>::IntoFuture
108-
kw await expr.await
109-
sn box Box::new(expr)
110-
sn call function(expr)
111-
sn dbg dbg!(expr)
112-
sn dbgr dbg!(&expr)
113-
sn deref *expr
114-
sn let let
115-
sn letm let mut
116-
sn match match expr {}
117-
sn ref &expr
118-
sn refm &mut expr
119-
sn return return expr
120-
sn unsafe unsafe {}
108+
kw await expr.await
109+
sn box Box::new(expr)
110+
sn call function(expr)
111+
sn dbg dbg!(expr)
112+
sn dbgr dbg!(&expr)
113+
sn deref *expr
114+
sn let let
115+
sn letm let mut
116+
sn match match expr {}
117+
sn ref &expr
118+
sn refm &mut expr
119+
sn return return expr
120+
sn unsafe unsafe {}
121121
"#]],
122122
);
123123
}
@@ -134,19 +134,19 @@ fn foo(a: A) { a.$0 }
134134
"#,
135135
expect![[r#"
136136
me into_future() (as IntoFuture) fn(self) -> <Self as IntoFuture>::IntoFuture
137-
kw await expr.await
138-
sn box Box::new(expr)
139-
sn call function(expr)
140-
sn dbg dbg!(expr)
141-
sn dbgr dbg!(&expr)
142-
sn deref *expr
143-
sn let let
144-
sn letm let mut
145-
sn match match expr {}
146-
sn ref &expr
147-
sn refm &mut expr
148-
sn return return expr
149-
sn unsafe unsafe {}
137+
kw await expr.await
138+
sn box Box::new(expr)
139+
sn call function(expr)
140+
sn dbg dbg!(expr)
141+
sn dbgr dbg!(&expr)
142+
sn deref *expr
143+
sn let let
144+
sn letm let mut
145+
sn match match expr {}
146+
sn ref &expr
147+
sn refm &mut expr
148+
sn return return expr
149+
sn unsafe unsafe {}
150150
"#]],
151151
);
152152
}

0 commit comments

Comments
 (0)