File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Sources/SwiftSyntaxMacroExpansion Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ private func expandAccessorMacroWithoutExistingAccessors(
275275
276276 // `expandAttachedMacro` adds the `{` and `}` to wrap the accessor block and
277277 // then indents it.
278- // Remove any indentaiton from the first line using `drop(while:)` and then
278+ // Remove any indentation from the first line using `drop(while:)` and then
279279 // prepend a space to separate it from the variable declaration
280280 let indentedSource = " " + expanded. indented ( by: attachedTo. indentationOfFirstLine) . drop ( while: { $0. isWhitespace } )
281281 return " \( raw: indentedSource) "
@@ -409,10 +409,11 @@ private func expandBodyMacro(
409409 return nil
410410 }
411411
412- // `expandAttachedMacro` adds the `{` and `}` to wrap the accessor block and
413- // then indents it.
414- // Remove any indentaiton from the first line using `drop(while:)` and then
415- // prepend a space to separate it from the variable declaration
412+ // `expandAttachedMacro` adds the `{` and `}` to wrap the body and then
413+ // indents it.
414+ // Remove any indentation from the first line using `drop(while:)` and then
415+ // prepend a space when it's being introduced on a declaration that has no
416+ // body yet.
416417 let leadingWhitespace = decl. body == nil ? " " : " "
417418 let indentedSource = leadingWhitespace + expanded. indented ( by: decl. indentationOfFirstLine) . drop ( while: { $0. isWhitespace } )
418419 return " \( raw: indentedSource) "
You can’t perform that action at this time.
0 commit comments