aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/completions/unqualified_path.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-22 15:31:47 +0000
committerGitHub <[email protected]>2021-01-22 15:31:47 +0000
commit0c37b3a0fc6d62cd1401320c53feb51a58ea09a6 (patch)
tree3798ba62e958b1c3642c30e4fab13011171b4837 /crates/completion/src/completions/unqualified_path.rs
parenta5322e3d5b813e4bce7a73762c14bebbd9a36e01 (diff)
parent08b822b25914bea7405a30383fe43c7235d14346 (diff)
Merge #7353
7353: Add LifetimeParam and ConstParam to CompletionItemKind r=matklad a=Veykril Adds `LifetimeParam` and `ConstParam` to `CompletionItemKind` and maps them both to `TypeParam` in the protocol conversion as there are no equivalents, so nothing really changes there. `ConstParam` could be mapped to `Const` I guess but I'm split on whether that would be better? Additions were solely inspired by (the single) test output for const params. Also sorts the variants of `CompletionItemKind` and its to_proto match. Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/completion/src/completions/unqualified_path.rs')
-rw-r--r--crates/completion/src/completions/unqualified_path.rs38
1 files changed, 19 insertions, 19 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs
index 809e1645a..a289efc34 100644
--- a/crates/completion/src/completions/unqualified_path.rs
+++ b/crates/completion/src/completions/unqualified_path.rs
@@ -165,8 +165,8 @@ fn quux(x: i32) {
165} 165}
166"#, 166"#,
167 expect![[r#" 167 expect![[r#"
168 bn y i32 168 lc y i32
169 bn x i32 169 lc x i32
170 fn quux(…) fn quux(x: i32) 170 fn quux(…) fn quux(x: i32)
171 "#]], 171 "#]],
172 ); 172 );
@@ -187,8 +187,8 @@ fn quux() {
187} 187}
188"#, 188"#,
189 expect![[r#" 189 expect![[r#"
190 bn b i32 190 lc b i32
191 bn a 191 lc a
192 fn quux() fn quux() 192 fn quux() fn quux()
193 "#]], 193 "#]],
194 ); 194 );
@@ -203,7 +203,7 @@ fn quux() {
203} 203}
204"#, 204"#,
205 expect![[r#" 205 expect![[r#"
206 bn x 206 lc x
207 fn quux() fn quux() 207 fn quux() fn quux()
208 "#]], 208 "#]],
209 ); 209 );
@@ -241,7 +241,7 @@ fn main() {
241 check( 241 check(
242 r#"fn quux<const C: usize>() { $0 }"#, 242 r#"fn quux<const C: usize>() { $0 }"#,
243 expect![[r#" 243 expect![[r#"
244 tp C 244 cp C
245 fn quux() fn quux<const C: usize>() 245 fn quux() fn quux<const C: usize>()
246 "#]], 246 "#]],
247 ); 247 );
@@ -263,7 +263,7 @@ fn main() {
263 check( 263 check(
264 r#"struct S<T> { x: $0}"#, 264 r#"struct S<T> { x: $0}"#,
265 expect![[r#" 265 expect![[r#"
266 tp Self 266 sp Self
267 tp T 267 tp T
268 st S<…> 268 st S<…>
269 "#]], 269 "#]],
@@ -275,7 +275,7 @@ fn main() {
275 check( 275 check(
276 r#"enum X { Y($0) }"#, 276 r#"enum X { Y($0) }"#,
277 expect![[r#" 277 expect![[r#"
278 tp Self 278 sp Self
279 en X 279 en X
280 "#]], 280 "#]],
281 ); 281 );
@@ -378,8 +378,8 @@ fn foo() {
378"#, 378"#,
379 // FIXME: should be only one bar here 379 // FIXME: should be only one bar here
380 expect![[r#" 380 expect![[r#"
381 bn bar i32 381 lc bar i32
382 bn bar i32 382 lc bar i32
383 fn foo() fn foo() 383 fn foo() fn foo()
384 "#]], 384 "#]],
385 ); 385 );
@@ -390,8 +390,8 @@ fn foo() {
390 check( 390 check(
391 r#"impl S { fn foo(&self) { $0 } }"#, 391 r#"impl S { fn foo(&self) { $0 } }"#,
392 expect![[r#" 392 expect![[r#"
393 bn self &{unknown} 393 lc self &{unknown}
394 tp Self 394 sp Self
395 "#]], 395 "#]],
396 ); 396 );
397 } 397 }
@@ -575,8 +575,8 @@ fn quux(x: i32) {
575} 575}
576"#, 576"#,
577 expect![[r#" 577 expect![[r#"
578 bn y i32 578 lc y i32
579 bn x i32 579 lc x i32
580 fn quux(…) fn quux(x: i32) 580 fn quux(…) fn quux(x: i32)
581 ma m!(…) macro_rules! m 581 ma m!(…) macro_rules! m
582 "#]], 582 "#]],
@@ -594,8 +594,8 @@ fn quux(x: i32) {
594} 594}
595", 595",
596 expect![[r#" 596 expect![[r#"
597 bn y i32 597 lc y i32
598 bn x i32 598 lc x i32
599 fn quux(…) fn quux(x: i32) 599 fn quux(…) fn quux(x: i32)
600 ma m!(…) macro_rules! m 600 ma m!(…) macro_rules! m
601 "#]], 601 "#]],
@@ -613,8 +613,8 @@ fn quux(x: i32) {
613} 613}
614"#, 614"#,
615 expect![[r#" 615 expect![[r#"
616 bn y i32 616 lc y i32
617 bn x i32 617 lc x i32
618 fn quux(…) fn quux(x: i32) 618 fn quux(…) fn quux(x: i32)
619 ma m!(…) macro_rules! m 619 ma m!(…) macro_rules! m
620 "#]], 620 "#]],
@@ -750,7 +750,7 @@ struct MyStruct {}
750impl My$0 750impl My$0
751"#, 751"#,
752 expect![[r#" 752 expect![[r#"
753 tp Self 753 sp Self
754 tt MyTrait 754 tt MyTrait
755 st MyStruct 755 st MyStruct
756 "#]], 756 "#]],