From a40f78f92ad2050d6178dfd70374701c6bc826ae Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 22 Jan 2021 18:59:22 +0300 Subject: 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 --- crates/completion/src/render.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/completion/src/render.rs') diff --git a/crates/completion/src/render.rs b/crates/completion/src/render.rs index fa594b5e5..6eb20df2b 100644 --- a/crates/completion/src/render.rs +++ b/crates/completion/src/render.rs @@ -523,7 +523,7 @@ fn main() { let _: m::Spam = S$0 } Function, ), lookup: "main", - detail: "fn main()", + detail: "-> ()", }, ] "#]], @@ -552,7 +552,7 @@ fn main() { som$0 } Function, ), lookup: "main", - detail: "fn main()", + detail: "-> ()", }, CompletionItem { label: "something_deprecated()", @@ -563,7 +563,7 @@ fn main() { som$0 } Function, ), lookup: "something_deprecated", - detail: "fn something_deprecated()", + detail: "-> ()", deprecated: true, }, CompletionItem { @@ -575,7 +575,7 @@ fn main() { som$0 } Function, ), lookup: "something_else_deprecated", - detail: "fn something_else_deprecated()", + detail: "-> ()", deprecated: true, }, ] @@ -626,7 +626,7 @@ impl S { insert: "bar()$0", kind: Method, lookup: "bar", - detail: "fn bar(self)", + detail: "-> ()", documentation: Documentation( "Method docs", ), @@ -726,7 +726,7 @@ fn foo(s: S) { s.$0 } insert: "the_method()$0", kind: Method, lookup: "the_method", - detail: "fn the_method(&self)", + detail: "-> ()", }, ] "#]], -- cgit v1.2.3