aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'crates/completion/src/render')
-rw-r--r--crates/completion/src/render/const_.rs2
-rw-r--r--crates/completion/src/render/enum_variant.rs2
-rw-r--r--crates/completion/src/render/function.rs2
-rw-r--r--crates/completion/src/render/macro_.rs8
-rw-r--r--crates/completion/src/render/type_alias.rs2
5 files changed, 15 insertions, 1 deletions
diff --git a/crates/completion/src/render/const_.rs b/crates/completion/src/render/const_.rs
index 829eb574d..3a1954211 100644
--- a/crates/completion/src/render/const_.rs
+++ b/crates/completion/src/render/const_.rs
@@ -1,3 +1,5 @@
1//! Renderer for `const` fields.
2
1use hir::HasSource; 3use hir::HasSource;
2use syntax::{ 4use syntax::{
3 ast::{Const, NameOwner}, 5 ast::{Const, NameOwner},
diff --git a/crates/completion/src/render/enum_variant.rs b/crates/completion/src/render/enum_variant.rs
index bc96cc303..f8b151318 100644
--- a/crates/completion/src/render/enum_variant.rs
+++ b/crates/completion/src/render/enum_variant.rs
@@ -1,3 +1,5 @@
1//! Renderer for `enum` variants.
2
1use hir::{HasAttrs, HirDisplay, ModPath, StructKind}; 3use hir::{HasAttrs, HirDisplay, ModPath, StructKind};
2use itertools::Itertools; 4use itertools::Itertools;
3use test_utils::mark; 5use test_utils::mark;
diff --git a/crates/completion/src/render/function.rs b/crates/completion/src/render/function.rs
index cf3852bf6..9d9bbe309 100644
--- a/crates/completion/src/render/function.rs
+++ b/crates/completion/src/render/function.rs
@@ -1,3 +1,5 @@
1//! Renderer for function calls.
2
1use hir::{HasSource, Type}; 3use hir::{HasSource, Type};
2use syntax::{ast::Fn, display::function_declaration}; 4use syntax::{ast::Fn, display::function_declaration};
3 5
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
1use hir::{Documentation, HasSource}; 3use hir::{Documentation, HasSource};
2use syntax::display::macro_label; 4use syntax::display::macro_label;
3use test_utils::mark; 5use 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 {
diff --git a/crates/completion/src/render/type_alias.rs b/crates/completion/src/render/type_alias.rs
index 378aa8c67..50a6d06c2 100644
--- a/crates/completion/src/render/type_alias.rs
+++ b/crates/completion/src/render/type_alias.rs
@@ -1,3 +1,5 @@
1//! Renderer for type aliases.
2
1use hir::HasSource; 3use hir::HasSource;
2use syntax::{ 4use syntax::{
3 ast::{NameOwner, TypeAlias}, 5 ast::{NameOwner, TypeAlias},