Open
Description
Description
If macro is nested in some closure, its trailing closure preserves the original code indentation. So if I build FunctionCallExprSyntax
with trailing closure that takes statements from the original trailing closure, the new statements are incorrectly indented.
This probably applies as well to closure as last argument.
Is there any manual way to trim the statements to decrease the indent?
Steps to Reproduce
assertMacroExpansion(
#"""
VStack {
#SomeMacro(arg1) { output in
EmptyView()
}
}
"""#,
expandedSource: #"""
VStack {
SomeWrapper(arg1) { output in
EmptyView()
}
}
"""#,
macros: testMacros
)
The code above incorrectly expands to:
#"""
VStack {
SomeWrapper(arg1) { output in
EmptyView()
}
}
"""#