Skip to content

Commit 35178f6

Browse files
roopekvahoppen
andauthored
Use .sourceAccurate instead of .all to check nextTokenStartsWithNewline
Co-authored-by: Alex Hoppen <[email protected]>
1 parent d5be4e5 commit 35178f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CodeGeneration/Sources/Utils/CodeGenerationFormat.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public class CodeGenerationFormat: BasicFormat {
137137
}
138138
decreaseIndentationLevel()
139139
if let lastChild = formattedChildren.last {
140-
let nextTokenStartsWithNewline = lastChild.nextToken(viewMode: .all)?.leadingTrivia.first?.isNewline ?? false
140+
let nextTokenStartsWithNewline = lastChild.nextToken(viewMode: .sourceAccurate)?.leadingTrivia.first?.isNewline ?? false
141141
if !nextTokenStartsWithNewline {
142142
formattedChildren[formattedChildren.count - 1] = lastChild.with(
143143
\.trailingTrivia,

0 commit comments

Comments
 (0)