aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/completions/unqualified_path.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-22 15:59:22 +0000
committerAleksey Kladov <[email protected]>2021-01-22 16:15:34 +0000
commita40f78f92ad2050d6178dfd70374701c6bc826ae (patch)
treebd1b08a23eeaecea0b2413454cca2ca0c6631bfe /crates/completion/src/completions/unqualified_path.rs
parent02a17cdffcfdea49981b4642be3027e564d28d9b (diff)
More useful fn detail in completion
Detail should be rendered as shtort one line, just dumping fn header there is not useful, despite the fact that TS does this. The fact that this is a function should be indicated by the icon, the same goes for pub/const/async etc qualitfiers name is already present in the lable (and arg list should be a part of that, as in idea) But the return type is the small genuinerlly useful bit of info we can show here
Diffstat (limited to 'crates/completion/src/completions/unqualified_path.rs')
-rw-r--r--crates/completion/src/completions/unqualified_path.rs50
1 files changed, 25 insertions, 25 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs
index a289efc34..5d62fab97 100644
--- a/crates/completion/src/completions/unqualified_path.rs
+++ b/crates/completion/src/completions/unqualified_path.rs
@@ -167,7 +167,7 @@ fn quux(x: i32) {
167 expect![[r#" 167 expect![[r#"
168 lc y i32 168 lc y i32
169 lc x i32 169 lc x i32
170 fn quux(…) fn quux(x: i32) 170 fn quux(…) -> ()
171 "#]], 171 "#]],
172 ); 172 );
173 } 173 }
@@ -189,7 +189,7 @@ fn quux() {
189 expect![[r#" 189 expect![[r#"
190 lc b i32 190 lc b i32
191 lc a 191 lc a
192 fn quux() fn quux() 192 fn quux() -> ()
193 "#]], 193 "#]],
194 ); 194 );
195 } 195 }
@@ -204,7 +204,7 @@ fn quux() {
204"#, 204"#,
205 expect![[r#" 205 expect![[r#"
206 lc x 206 lc x
207 fn quux() fn quux() 207 fn quux() -> ()
208 "#]], 208 "#]],
209 ); 209 );
210 } 210 }
@@ -235,14 +235,14 @@ fn main() {
235 r#"fn quux<T>() { $0 }"#, 235 r#"fn quux<T>() { $0 }"#,
236 expect![[r#" 236 expect![[r#"
237 tp T 237 tp T
238 fn quux() fn quux<T>() 238 fn quux() -> ()
239 "#]], 239 "#]],
240 ); 240 );
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 cp C 244 cp C
245 fn quux() fn quux<const C: usize>() 245 fn quux() -> ()
246 "#]], 246 "#]],
247 ); 247 );
248 } 248 }
@@ -253,7 +253,7 @@ fn main() {
253 check( 253 check(
254 r#"fn quux<'a>() { $0 }"#, 254 r#"fn quux<'a>() { $0 }"#,
255 expect![[r#" 255 expect![[r#"
256 fn quux() fn quux<'a>() 256 fn quux() -> ()
257 "#]], 257 "#]],
258 ); 258 );
259 } 259 }
@@ -291,7 +291,7 @@ fn quux() { $0 }
291"#, 291"#,
292 expect![[r#" 292 expect![[r#"
293 st S 293 st S
294 fn quux() fn quux() 294 fn quux() -> ()
295 en E 295 en E
296 "#]], 296 "#]],
297 ); 297 );
@@ -344,7 +344,7 @@ mod m {
344} 344}
345"#, 345"#,
346 expect![[r#" 346 expect![[r#"
347 fn quux() fn quux() 347 fn quux() -> ()
348 st Bar 348 st Bar
349 "#]], 349 "#]],
350 ); 350 );
@@ -359,7 +359,7 @@ fn x() -> $0
359"#, 359"#,
360 expect![[r#" 360 expect![[r#"
361 st Foo 361 st Foo
362 fn x() fn x() 362 fn x() -> ()
363 "#]], 363 "#]],
364 ); 364 );
365 } 365 }
@@ -380,7 +380,7 @@ fn foo() {
380 expect![[r#" 380 expect![[r#"
381 lc bar i32 381 lc bar i32
382 lc bar i32 382 lc bar i32
383 fn foo() fn foo() 383 fn foo() -> ()
384 "#]], 384 "#]],
385 ); 385 );
386 } 386 }
@@ -410,7 +410,7 @@ use prelude::*;
410mod prelude { struct Option; } 410mod prelude { struct Option; }
411"#, 411"#,
412 expect![[r#" 412 expect![[r#"
413 fn foo() fn foo() 413 fn foo() -> ()
414 md std 414 md std
415 st Option 415 st Option
416 "#]], 416 "#]],
@@ -440,7 +440,7 @@ mod macros {
440} 440}
441"#, 441"#,
442 expect![[r##" 442 expect![[r##"
443 fn f() fn f() 443 fn f() -> ()
444 ma concat!(…) #[macro_export] macro_rules! concat 444 ma concat!(…) #[macro_export] macro_rules! concat
445 md std 445 md std
446 "##]], 446 "##]],
@@ -467,7 +467,7 @@ use prelude::*;
467mod prelude { struct String; } 467mod prelude { struct String; }
468"#, 468"#,
469 expect![[r#" 469 expect![[r#"
470 fn foo() fn foo() 470 fn foo() -> ()
471 md std 471 md std
472 md core 472 md core
473 st String 473 st String
@@ -498,7 +498,7 @@ fn main() { let v = $0 }
498 expect![[r##" 498 expect![[r##"
499 md m1 499 md m1
500 ma baz!(…) #[macro_export] macro_rules! baz 500 ma baz!(…) #[macro_export] macro_rules! baz
501 fn main() fn main() 501 fn main() -> ()
502 md m2 502 md m2
503 ma bar!(…) macro_rules! bar 503 ma bar!(…) macro_rules! bar
504 ma foo!(…) macro_rules! foo 504 ma foo!(…) macro_rules! foo
@@ -514,7 +514,7 @@ macro_rules! foo { () => {} }
514fn foo() { $0 } 514fn foo() { $0 }
515"#, 515"#,
516 expect![[r#" 516 expect![[r#"
517 fn foo() fn foo() 517 fn foo() -> ()
518 ma foo!(…) macro_rules! foo 518 ma foo!(…) macro_rules! foo
519 "#]], 519 "#]],
520 ); 520 );
@@ -528,7 +528,7 @@ macro_rules! foo { () => {} }
528fn main() { let x: $0 } 528fn main() { let x: $0 }
529"#, 529"#,
530 expect![[r#" 530 expect![[r#"
531 fn main() fn main() 531 fn main() -> ()
532 ma foo!(…) macro_rules! foo 532 ma foo!(…) macro_rules! foo
533 "#]], 533 "#]],
534 ); 534 );
@@ -542,7 +542,7 @@ macro_rules! foo { () => {} }
542fn main() { $0 } 542fn main() { $0 }
543"#, 543"#,
544 expect![[r#" 544 expect![[r#"
545 fn main() fn main() 545 fn main() -> ()
546 ma foo!(…) macro_rules! foo 546 ma foo!(…) macro_rules! foo
547 "#]], 547 "#]],
548 ); 548 );
@@ -558,8 +558,8 @@ fn main() {
558} 558}
559"#, 559"#,
560 expect![[r#" 560 expect![[r#"
561 fn frobnicate() fn frobnicate() 561 fn frobnicate() -> ()
562 fn main() fn main() 562 fn main() -> ()
563 "#]], 563 "#]],
564 ); 564 );
565 } 565 }
@@ -577,7 +577,7 @@ fn quux(x: i32) {
577 expect![[r#" 577 expect![[r#"
578 lc y i32 578 lc y i32
579 lc x i32 579 lc x i32
580 fn quux(…) fn quux(x: i32) 580 fn quux(…) -> ()
581 ma m!(…) macro_rules! m 581 ma m!(…) macro_rules! m
582 "#]], 582 "#]],
583 ); 583 );
@@ -596,7 +596,7 @@ fn quux(x: i32) {
596 expect![[r#" 596 expect![[r#"
597 lc y i32 597 lc y i32
598 lc x i32 598 lc x i32
599 fn quux(…) fn quux(x: i32) 599 fn quux(…) -> ()
600 ma m!(…) macro_rules! m 600 ma m!(…) macro_rules! m
601 "#]], 601 "#]],
602 ); 602 );
@@ -615,7 +615,7 @@ fn quux(x: i32) {
615 expect![[r#" 615 expect![[r#"
616 lc y i32 616 lc y i32
617 lc x i32 617 lc x i32
618 fn quux(…) fn quux(x: i32) 618 fn quux(…) -> ()
619 ma m!(…) macro_rules! m 619 ma m!(…) macro_rules! m
620 "#]], 620 "#]],
621 ); 621 );
@@ -630,7 +630,7 @@ use spam::Quux;
630fn main() { $0 } 630fn main() { $0 }
631"#, 631"#,
632 expect![[r#" 632 expect![[r#"
633 fn main() fn main() 633 fn main() -> ()
634 ?? Quux 634 ?? Quux
635 "#]], 635 "#]],
636 ); 636 );
@@ -708,7 +708,7 @@ fn main() { let foo: Foo = Q$0 }
708 ev Foo::Baz () 708 ev Foo::Baz ()
709 ev Foo::Quux () 709 ev Foo::Quux ()
710 en Foo 710 en Foo
711 fn main() fn main() 711 fn main() -> ()
712 "#]], 712 "#]],
713 ) 713 )
714 } 714 }
@@ -723,7 +723,7 @@ fn f() -> m::E { V$0 }
723 expect![[r#" 723 expect![[r#"
724 ev m::E::V () 724 ev m::E::V ()
725 md m 725 md m
726 fn f() fn f() -> m::E 726 fn f() -> E
727 "#]], 727 "#]],
728 ) 728 )
729 } 729 }