From 53bb46fa853bee99f673a0ed0a53798c46847d99 Mon Sep 17 00:00:00 2001 From: Josh Mcguigan Date: Sat, 6 Mar 2021 16:56:07 -0800 Subject: show function params in completion detail --- crates/ide_completion/src/completions/dot.rs | 24 +++++----- crates/ide_completion/src/completions/flyimport.rs | 8 ++-- .../src/completions/qualified_path.rs | 56 +++++++++++----------- .../src/completions/unqualified_path.rs | 50 +++++++++---------- 4 files changed, 69 insertions(+), 69 deletions(-) (limited to 'crates/ide_completion/src/completions') diff --git a/crates/ide_completion/src/completions/dot.rs b/crates/ide_completion/src/completions/dot.rs index 5ee9a9f07..cec2d0c3a 100644 --- a/crates/ide_completion/src/completions/dot.rs +++ b/crates/ide_completion/src/completions/dot.rs @@ -81,7 +81,7 @@ fn foo(s: S) { s.$0 } "#, expect![[r#" fd foo u32 - me bar() -> () + me bar() fn(&self) "#]], ); } @@ -97,7 +97,7 @@ impl S { "#, expect![[r#" fd the_field (u32,) - me foo() -> () + me foo() fn(self) "#]], ) } @@ -113,7 +113,7 @@ impl A { "#, expect![[r#" fd the_field (u32, i32) - me foo() -> () + me foo() fn(&self) "#]], ) } @@ -163,7 +163,7 @@ mod m { fn foo(a: A) { a.$0 } "#, expect![[r#" - me the_method() -> () + me the_method() fn(&self) "#]], ); } @@ -196,7 +196,7 @@ impl A { fn foo(a: A) { a.$0 } "#, expect![[r#" - me the_method() -> () + me the_method() fn(&self) "#]], ) } @@ -211,7 +211,7 @@ impl Trait for A {} fn foo(a: A) { a.$0 } "#, expect![[r#" - me the_method() -> () + me the_method() fn(&self) "#]], ); } @@ -226,7 +226,7 @@ impl Trait for T {} fn foo(a: &A) { a.$0 } ", expect![[r#" - me the_method() -> () + me the_method() fn(&self) "#]], ); } @@ -244,7 +244,7 @@ impl Trait for A {} fn foo(a: A) { a.$0 } ", expect![[r#" - me the_method() -> () + me the_method() fn(&self) "#]], ); } @@ -298,7 +298,7 @@ impl T { } "#, expect![[r#" - me blah() -> () + me blah() fn(&self) "#]], ); } @@ -407,7 +407,7 @@ fn foo() { } "#, expect![[r#" - me the_method() -> () + me the_method() fn(&self) "#]], ); } @@ -422,7 +422,7 @@ macro_rules! make_s { () => { S }; } fn main() { make_s!().f$0; } "#, expect![[r#" - me foo() -> () + me foo() fn(&self) "#]], ) } @@ -450,7 +450,7 @@ mod foo { } "#, expect![[r#" - me private() -> () + me private() fn(&self) "#]], ); } diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs index 391a11c91..08df2df3f 100644 --- a/crates/ide_completion/src/completions/flyimport.rs +++ b/crates/ide_completion/src/completions/flyimport.rs @@ -402,7 +402,7 @@ fn main() { check( fixture, expect![[r#" - fn weird_function() (dep::test_mod::TestTrait) -> () + fn weird_function() (dep::test_mod::TestTrait) fn() "#]], ); @@ -495,7 +495,7 @@ fn main() { check( fixture, expect![[r#" - me random_method() (dep::test_mod::TestTrait) -> () + me random_method() (dep::test_mod::TestTrait) fn(&self) "#]], ); @@ -665,7 +665,7 @@ fn main() { } "#, expect![[r#" - me random_method() (dep::test_mod::TestTrait) -> () DEPRECATED + me random_method() (dep::test_mod::TestTrait) fn(&self) DEPRECATED "#]], ); @@ -696,7 +696,7 @@ fn main() { "#, expect![[r#" ct SPECIAL_CONST (dep::test_mod::TestTrait) DEPRECATED - fn weird_function() (dep::test_mod::TestTrait) -> () DEPRECATED + fn weird_function() (dep::test_mod::TestTrait) fn() DEPRECATED "#]], ); } diff --git a/crates/ide_completion/src/completions/qualified_path.rs b/crates/ide_completion/src/completions/qualified_path.rs index df74b739e..105ff6013 100644 --- a/crates/ide_completion/src/completions/qualified_path.rs +++ b/crates/ide_completion/src/completions/qualified_path.rs @@ -359,8 +359,8 @@ impl S { fn foo() { let _ = S::$0 } "#, expect![[r#" - fn a() -> () - me b(…) -> () + fn a() fn() + me b(…) fn(&self) ct C const C: i32 = 42; ta T type T = i32; "#]], @@ -387,7 +387,7 @@ mod m { fn foo() { let _ = S::$0 } "#, expect![[r#" - fn public_method() -> () + fn public_method() fn() ct PUBLIC_CONST pub(crate) const PUBLIC_CONST: u32 = 1; ta PublicType pub(crate) type PublicType = u32; "#]], @@ -404,7 +404,7 @@ impl E { fn m() { } } fn foo() { let _ = E::$0 } "#, expect![[r#" - fn m() -> () + fn m() fn() "#]], ); } @@ -419,7 +419,7 @@ impl U { fn m() { } } fn foo() { let _ = U::$0 } "#, expect![[r#" - fn m() -> () + fn m() fn() "#]], ); } @@ -449,7 +449,7 @@ trait Trait { fn m(); } fn foo() { let _ = Trait::$0 } "#, expect![[r#" - fn m() -> () + fn m() fn() "#]], ); } @@ -466,7 +466,7 @@ impl Trait for S {} fn foo() { let _ = S::$0 } "#, expect![[r#" - fn m() -> () + fn m() fn() "#]], ); } @@ -483,7 +483,7 @@ impl Trait for S {} fn foo() { let _ = ::$0 } "#, expect![[r#" - fn m() -> () + fn m() fn() "#]], ); } @@ -512,11 +512,11 @@ fn foo() { T::$0 } ta SubTy type SubTy; ta Ty type Ty; ct C2 const C2: (); - fn subfunc() -> () - me submethod(…) -> () + fn subfunc() fn() + me submethod(…) fn(&self) ct CONST const CONST: u8; - fn func() -> () - me method(…) -> () + fn func() fn() + me method(…) fn(&self) "#]], ); } @@ -552,11 +552,11 @@ impl Sub for Wrap { ta SubTy type SubTy; ta Ty type Ty; ct CONST const CONST: u8 = 0; - fn func() -> () - me method(…) -> () + fn func() fn() + me method(…) fn(&self) ct C2 const C2: () = (); - fn subfunc() -> () - me submethod(…) -> () + fn subfunc() fn() + me submethod(…) fn(&self) "#]], ); } @@ -573,8 +573,8 @@ impl T { fn bar() {} } fn main() { T::$0; } "#, expect![[r#" - fn foo() -> () - fn bar() -> () + fn foo() fn() + fn bar() fn() "#]], ); } @@ -589,7 +589,7 @@ macro_rules! foo { () => {} } fn main() { let _ = crate::$0 } "#, expect![[r##" - fn main() -> () + fn main() fn() ma foo!(…) #[macro_export] macro_rules! foo "##]], ); @@ -633,7 +633,7 @@ mod p { "#, expect![[r#" ct RIGHT_CONST - fn right_fn() -> () + fn right_fn() fn() st RightType "#]], ); @@ -680,8 +680,8 @@ fn main() { m!(self::f$0); } fn foo() {} "#, expect![[r#" - fn main() -> () - fn foo() -> () + fn main() fn() + fn foo() fn() "#]], ); } @@ -699,7 +699,7 @@ mod m { "#, expect![[r#" md z - fn z() -> () + fn z() fn() "#]], ); } @@ -719,7 +719,7 @@ fn foo() { } "#, expect![[r#" - fn new() -> HashMap + fn new() fn() -> HashMap "#]], ); } @@ -752,8 +752,8 @@ fn main() { } "#, expect![[r#" - fn main() -> () - fn foo(…) -> () + fn main() fn() + fn foo(…) fn(i32, i32) "#]], ); } @@ -776,7 +776,7 @@ impl Foo { expect![[r#" ev Bar () ev Baz () - me foo(…) -> () + me foo(…) fn(self) "#]], ); } @@ -800,7 +800,7 @@ impl u8 { "#, expect![[r#" ct MAX pub const MAX: Self = 255; - me func(…) -> () + me func(…) fn(self) "#]], ); } diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs index 044dfd160..e4bf4a043 100644 --- a/crates/ide_completion/src/completions/unqualified_path.rs +++ b/crates/ide_completion/src/completions/unqualified_path.rs @@ -139,7 +139,7 @@ fn quux(x: i32) { expect![[r#" lc y i32 lc x i32 - fn quux(…) -> () + fn quux(…) fn(i32) "#]], ); } @@ -161,7 +161,7 @@ fn quux() { expect![[r#" lc b i32 lc a - fn quux() -> () + fn quux() fn() "#]], ); } @@ -176,7 +176,7 @@ fn quux() { "#, expect![[r#" lc x - fn quux() -> () + fn quux() fn() "#]], ); } @@ -207,14 +207,14 @@ fn main() { r#"fn quux() { $0 }"#, expect![[r#" tp T - fn quux() -> () + fn quux() fn() "#]], ); check( r#"fn quux() { $0 }"#, expect![[r#" cp C - fn quux() -> () + fn quux() fn() "#]], ); } @@ -225,7 +225,7 @@ fn main() { check( r#"fn quux<'a>() { $0 }"#, expect![[r#" - fn quux() -> () + fn quux() fn() "#]], ); } @@ -263,7 +263,7 @@ fn quux() { $0 } "#, expect![[r#" st S - fn quux() -> () + fn quux() fn() en E "#]], ); @@ -316,7 +316,7 @@ mod m { } "#, expect![[r#" - fn quux() -> () + fn quux() fn() st Bar "#]], ); @@ -331,7 +331,7 @@ fn x() -> $0 "#, expect![[r#" st Foo - fn x() -> () + fn x() fn() "#]], ); } @@ -352,7 +352,7 @@ fn foo() { expect![[r#" lc bar i32 lc bar i32 - fn foo() -> () + fn foo() fn() "#]], ); } @@ -382,7 +382,7 @@ use prelude::*; mod prelude { struct Option; } "#, expect![[r#" - fn foo() -> () + fn foo() fn() md std st Option "#]], @@ -412,7 +412,7 @@ mod macros { } "#, expect![[r##" - fn f() -> () + fn f() fn() ma concat!(…) #[macro_export] macro_rules! concat md std "##]], @@ -439,7 +439,7 @@ use prelude::*; mod prelude { struct String; } "#, expect![[r#" - fn foo() -> () + fn foo() fn() md std md core st String @@ -470,7 +470,7 @@ fn main() { let v = $0 } expect![[r##" md m1 ma baz!(…) #[macro_export] macro_rules! baz - fn main() -> () + fn main() fn() md m2 ma bar!(…) macro_rules! bar ma foo!(…) macro_rules! foo @@ -486,7 +486,7 @@ macro_rules! foo { () => {} } fn foo() { $0 } "#, expect![[r#" - fn foo() -> () + fn foo() fn() ma foo!(…) macro_rules! foo "#]], ); @@ -500,7 +500,7 @@ macro_rules! foo { () => {} } fn main() { let x: $0 } "#, expect![[r#" - fn main() -> () + fn main() fn() ma foo!(…) macro_rules! foo "#]], ); @@ -514,7 +514,7 @@ macro_rules! foo { () => {} } fn main() { $0 } "#, expect![[r#" - fn main() -> () + fn main() fn() ma foo!(…) macro_rules! foo "#]], ); @@ -530,8 +530,8 @@ fn main() { } "#, expect![[r#" - fn frobnicate() -> () - fn main() -> () + fn frobnicate() fn() + fn main() fn() "#]], ); } @@ -549,7 +549,7 @@ fn quux(x: i32) { expect![[r#" lc y i32 lc x i32 - fn quux(…) -> () + fn quux(…) fn(i32) ma m!(…) macro_rules! m "#]], ); @@ -568,7 +568,7 @@ fn quux(x: i32) { expect![[r#" lc y i32 lc x i32 - fn quux(…) -> () + fn quux(…) fn(i32) ma m!(…) macro_rules! m "#]], ); @@ -587,7 +587,7 @@ fn quux(x: i32) { expect![[r#" lc y i32 lc x i32 - fn quux(…) -> () + fn quux(…) fn(i32) ma m!(…) macro_rules! m "#]], ); @@ -602,7 +602,7 @@ use spam::Quux; fn main() { $0 } "#, expect![[r#" - fn main() -> () + fn main() fn() ?? Quux "#]], ); @@ -680,7 +680,7 @@ fn main() { let foo: Foo = Q$0 } ev Foo::Baz () ev Foo::Quux () en Foo - fn main() -> () + fn main() fn() "#]], ) } @@ -695,7 +695,7 @@ fn f() -> m::E { V$0 } expect![[r#" ev m::E::V () md m - fn f() -> E + fn f() fn() -> E "#]], ) } -- cgit v1.2.3