Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/render/macro_.rs')
-rw-r--r--crates/ide-completion/src/render/macro_.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/ide-completion/src/render/macro_.rs b/crates/ide-completion/src/render/macro_.rs
index de527860d8..26690d22ab 100644
--- a/crates/ide-completion/src/render/macro_.rs
+++ b/crates/ide-completion/src/render/macro_.rs
@@ -5,7 +5,7 @@ use ide_db::SymbolKind;
use syntax::SmolStr;
use crate::{
- context::{PathCompletionCtx, PathKind},
+ context::{IdentContext, NameRefContext, NameRefKind, PathCompletionCtx, PathKind},
item::{Builder, CompletionItem},
render::RenderContext,
};
@@ -33,10 +33,11 @@ fn render(
let is_fn_like = macro_.is_fn_like(completion.db);
let (bra, ket) = if is_fn_like { guess_macro_braces(&name, docs_str) } else { ("", "") };
- let needs_bang = match completion.path_context() {
- Some(PathCompletionCtx { kind, has_macro_bang, .. }) => {
- is_fn_like && *kind != PathKind::Use && !has_macro_bang
- }
+ let needs_bang = match &completion.ident_ctx {
+ IdentContext::NameRef(NameRefContext {
+ kind: Some(NameRefKind::Path(PathCompletionCtx { kind, has_macro_bang, .. })),
+ ..
+ }) => is_fn_like && *kind != PathKind::Use && !has_macro_bang,
_ => is_fn_like,
};