diff options
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 { |