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/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'crates/completion/src/lib.rs') diff --git a/crates/completion/src/lib.rs b/crates/completion/src/lib.rs index 2c4e54524..50329b499 100644 --- a/crates/completion/src/lib.rs +++ b/crates/completion/src/lib.rs @@ -227,7 +227,7 @@ mod tests { bar.fo$0; } "#, - DetailAndDocumentation { detail: "fn foo(&self)", documentation: "Do the foo" }, + DetailAndDocumentation { detail: "-> ()", documentation: "Do the foo" }, ); } @@ -253,7 +253,7 @@ mod tests { bar.fo$0; } "#, - DetailAndDocumentation { detail: "fn foo(&self)", documentation: " Do the foo" }, + DetailAndDocumentation { detail: "-> ()", documentation: " Do the foo" }, ); } @@ -277,10 +277,7 @@ mod tests { for c in fo$0 } "#, - DetailAndDocumentation { - detail: "fn foo() -> &'static str", - documentation: "Do the foo", - }, + DetailAndDocumentation { detail: "-> &str", documentation: "Do the foo" }, ); } } -- cgit v1.2.3