diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-12 11:00:08 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-12 11:00:08 +0100 |
commit | 87429768bd6cbe73a818e73ac1aaee65a8b59ec5 (patch) | |
tree | abc5939088c5cc91b60e34f890ee49ecc91707bc | |
parent | b93408d0b2609b82f869b1953122df4a46bb0014 (diff) | |
parent | 7543b06d301024d10b803f4c2bc269af9d481296 (diff) |
Merge #5711
5711: Display snippet in the completion label r=matklad a=SomeoneToIgnore
Before, the completion did not show the actual snippet and it was hard to understand what to input to get the right snippet:
<img width="467" alt="image" src="https://user-images.githubusercontent.com/2690773/89941040-21f6a600-dc23-11ea-94b8-61f77f88feaf.png">
<img width="367" alt="image" src="https://user-images.githubusercontent.com/2690773/89941046-23c06980-dc23-11ea-8034-6c4e14357c94.png">
Now it's more clear:
<img width="315" alt="image" src="https://user-images.githubusercontent.com/2690773/89941124-42befb80-dc23-11ea-9fcc-5fd49cc92b74.png">
<img width="210" alt="image" src="https://user-images.githubusercontent.com/2690773/89941132-4488bf00-dc23-11ea-99c2-12ec66e0a044.png">
Co-authored-by: Kirill Bulatov <[email protected]>
-rw-r--r-- | crates/ra_ide/src/completion/complete_snippet.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide/src/completion/complete_snippet.rs b/crates/ra_ide/src/completion/complete_snippet.rs index 28d8f7876..4368e4eec 100644 --- a/crates/ra_ide/src/completion/complete_snippet.rs +++ b/crates/ra_ide/src/completion/complete_snippet.rs | |||
@@ -36,7 +36,7 @@ pub(super) fn complete_item_snippet(acc: &mut Completions, ctx: &CompletionConte | |||
36 | snippet( | 36 | snippet( |
37 | ctx, | 37 | ctx, |
38 | cap, | 38 | cap, |
39 | "Test module", | 39 | "tmod (Test module)", |
40 | "\ | 40 | "\ |
41 | #[cfg(test)] | 41 | #[cfg(test)] |
42 | mod tests { | 42 | mod tests { |
@@ -54,7 +54,7 @@ mod tests { | |||
54 | snippet( | 54 | snippet( |
55 | ctx, | 55 | ctx, |
56 | cap, | 56 | cap, |
57 | "Test function", | 57 | "tfn (Test function)", |
58 | "\ | 58 | "\ |
59 | #[test] | 59 | #[test] |
60 | fn ${1:feature}() { | 60 | fn ${1:feature}() { |
@@ -106,10 +106,10 @@ mod tests { | |||
106 | } | 106 | } |
107 | "#, | 107 | "#, |
108 | expect![[r#" | 108 | expect![[r#" |
109 | sn Test function | ||
110 | sn Test module | ||
111 | sn macro_rules | 109 | sn macro_rules |
112 | sn pub(crate) | 110 | sn pub(crate) |
111 | sn tfn (Test function) | ||
112 | sn tmod (Test module) | ||
113 | "#]], | 113 | "#]], |
114 | ) | 114 | ) |
115 | } | 115 | } |