Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 36298c6

Browse files
committed
fix:do not handle callsites in macros' parameters
1 parent 8929853 commit 36298c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/ide-assists/src/handlers/inline_call.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ pub(crate) fn inline_into_callers(acc: &mut Assists, ctx: &AssistContext<'_>) ->
107107
let call_infos: Vec<_> = name_refs
108108
.into_iter()
109109
.filter_map(CallInfo::from_name_ref)
110+
// FIXME: do not handle callsites in macros' parameters, because
111+
// directly inlining into macros may cause errors.
112+
.filter(|call_info| !ctx.sema.hir_file_for(call_info.node.syntax()).is_macro())
110113
.map(|call_info| {
111114
let mut_node = builder.make_syntax_mut(call_info.node.syntax().clone());
112115
(call_info, mut_node)

0 commit comments

Comments
 (0)