diff options
Diffstat (limited to 'crates/ide_completion/src/render/macro_.rs')
-rw-r--r-- | crates/ide_completion/src/render/macro_.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/ide_completion/src/render/macro_.rs b/crates/ide_completion/src/render/macro_.rs index b90fd3890..0dfba8acc 100644 --- a/crates/ide_completion/src/render/macro_.rs +++ b/crates/ide_completion/src/render/macro_.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! Renderer for macro invocations. | 1 | //! Renderer for macro invocations. |
2 | 2 | ||
3 | use hir::{Documentation, HasSource}; | 3 | use hir::HasSource; |
4 | use ide_db::SymbolKind; | 4 | use ide_db::SymbolKind; |
5 | use syntax::display::macro_label; | 5 | use syntax::display::macro_label; |
6 | 6 | ||
@@ -12,7 +12,7 @@ use crate::{ | |||
12 | pub(crate) fn render_macro<'a>( | 12 | pub(crate) fn render_macro<'a>( |
13 | ctx: RenderContext<'a>, | 13 | ctx: RenderContext<'a>, |
14 | import_to_add: Option<ImportEdit>, | 14 | import_to_add: Option<ImportEdit>, |
15 | name: String, | 15 | name: hir::Name, |
16 | macro_: hir::MacroDef, | 16 | macro_: hir::MacroDef, |
17 | ) -> Option<CompletionItem> { | 17 | ) -> Option<CompletionItem> { |
18 | let _p = profile::span("render_macro"); | 18 | let _p = profile::span("render_macro"); |
@@ -24,13 +24,14 @@ struct MacroRender<'a> { | |||
24 | ctx: RenderContext<'a>, | 24 | ctx: RenderContext<'a>, |
25 | name: String, | 25 | name: String, |
26 | macro_: hir::MacroDef, | 26 | macro_: hir::MacroDef, |
27 | docs: Option<Documentation>, | 27 | docs: Option<hir::Documentation>, |
28 | bra: &'static str, | 28 | bra: &'static str, |
29 | ket: &'static str, | 29 | ket: &'static str, |
30 | } | 30 | } |
31 | 31 | ||
32 | impl<'a> MacroRender<'a> { | 32 | impl<'a> MacroRender<'a> { |
33 | fn new(ctx: RenderContext<'a>, name: String, macro_: hir::MacroDef) -> MacroRender<'a> { | 33 | fn new(ctx: RenderContext<'a>, name: hir::Name, macro_: hir::MacroDef) -> MacroRender<'a> { |
34 | let name = name.to_string(); | ||
34 | let docs = ctx.docs(macro_); | 35 | let docs = ctx.docs(macro_); |
35 | let docs_str = docs.as_ref().map_or("", |s| s.as_str()); | 36 | let docs_str = docs.as_ref().map_or("", |s| s.as_str()); |
36 | let (bra, ket) = guess_macro_braces(&name, docs_str); | 37 | let (bra, ket) = guess_macro_braces(&name, docs_str); |