aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/lib.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/lib.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/lib.rs')
-rw-r--r--crates/completion/src/lib.rs9
1 files changed, 3 insertions, 6 deletions
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 {
227 bar.fo$0; 227 bar.fo$0;
228 } 228 }
229 "#, 229 "#,
230 DetailAndDocumentation { detail: "fn foo(&self)", documentation: "Do the foo" }, 230 DetailAndDocumentation { detail: "-> ()", documentation: "Do the foo" },
231 ); 231 );
232 } 232 }
233 233
@@ -253,7 +253,7 @@ mod tests {
253 bar.fo$0; 253 bar.fo$0;
254 } 254 }
255 "#, 255 "#,
256 DetailAndDocumentation { detail: "fn foo(&self)", documentation: " Do the foo" }, 256 DetailAndDocumentation { detail: "-> ()", documentation: " Do the foo" },
257 ); 257 );
258 } 258 }
259 259
@@ -277,10 +277,7 @@ mod tests {
277 for c in fo$0 277 for c in fo$0
278 } 278 }
279 "#, 279 "#,
280 DetailAndDocumentation { 280 DetailAndDocumentation { detail: "-> &str", documentation: "Do the foo" },
281 detail: "fn foo() -> &'static str",
282 documentation: "Do the foo",
283 },
284 ); 281 );
285 } 282 }
286} 283}