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(
275
275
276
276
// `expandAttachedMacro` adds the `{` and `}` to wrap the accessor block and
277
277
// 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
279
279
// prepend a space to separate it from the variable declaration
280
280
let indentedSource = " " + expanded. indented ( by: attachedTo. indentationOfFirstLine) . drop ( while: { $0. isWhitespace } )
281
281
return " \( raw: indentedSource) "
@@ -409,10 +409,11 @@ private func expandBodyMacro(
409
409
return nil
410
410
}
411
411
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.
416
417
let leadingWhitespace = decl. body == nil ? " " : " "
417
418
let indentedSource = leadingWhitespace + expanded. indented ( by: decl. indentationOfFirstLine) . drop ( while: { $0. isWhitespace } )
418
419
return " \( raw: indentedSource) "
You can’t perform that action at this time.
0 commit comments