diff options
author | Igor Aleksanov <[email protected]> | 2020-11-01 10:48:42 +0000 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-11-03 07:16:35 +0000 |
commit | 2a214e15d38c7d97243e23e5e26fee5f4e26bb50 (patch) | |
tree | c99a4d7362b6831b490efecb7e6d603cffc17fc1 /crates/completion/src/render/macro_.rs | |
parent | af7175f3328c08e39d746c7e7b83c397dd2769bf (diff) |
Add doc-comments to the new files
Diffstat (limited to 'crates/completion/src/render/macro_.rs')
-rw-r--r-- | crates/completion/src/render/macro_.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/completion/src/render/macro_.rs b/crates/completion/src/render/macro_.rs index 6df121c66..066185559 100644 --- a/crates/completion/src/render/macro_.rs +++ b/crates/completion/src/render/macro_.rs | |||
@@ -1,3 +1,5 @@ | |||
1 | //! Renderer for macro invocations. | ||
2 | |||
1 | use hir::{Documentation, HasSource}; | 3 | use hir::{Documentation, HasSource}; |
2 | use syntax::display::macro_label; | 4 | use syntax::display::macro_label; |
3 | use test_utils::mark; | 5 | use test_utils::mark; |
@@ -66,7 +68,11 @@ impl<'a> MacroRender<'a> { | |||
66 | } | 68 | } |
67 | 69 | ||
68 | fn label(&self) -> String { | 70 | fn label(&self) -> String { |
69 | format!("{}!{}…{}", self.name, self.bra, self.ket) | 71 | if self.needs_bang() && self.ctx.snippet_cap().is_some() { |
72 | format!("{}!{}…{}", self.name, self.bra, self.ket) | ||
73 | } else { | ||
74 | self.banged_name() | ||
75 | } | ||
70 | } | 76 | } |
71 | 77 | ||
72 | fn snippet(&self) -> String { | 78 | fn snippet(&self) -> String { |