Skip to content

Commit 9b51a7b

Browse files
committed
Fix CodeGenerationFormat to not indent empty lines
1 parent 0cdde9c commit 9b51a7b

38 files changed

+9230
-9230
lines changed

CodeGeneration/Sources/Utils/CodeGenerationFormat.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ public class CodeGenerationFormat: BasicFormat {
133133

134134
private func ensuringTwoLeadingNewlines<NodeType: SyntaxProtocol>(node: NodeType) -> NodeType {
135135
if node.leadingTrivia.first?.isNewline ?? false {
136-
return node.with(\.leadingTrivia, indentedNewline + node.leadingTrivia)
136+
return node.with(\.leadingTrivia, .newline + node.leadingTrivia)
137137
} else {
138-
return node.with(\.leadingTrivia, indentedNewline + indentedNewline + node.leadingTrivia)
138+
return node.with(\.leadingTrivia, .newlines(2) + node.leadingTrivia)
139139
}
140140
}
141141

Sources/SwiftParser/generated/ExperimentalFeatures.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extension Parser {
1616
@_spi(ExperimentalLanguageFeatures)
1717
public struct ExperimentalFeatures: OptionSet, Sendable {
1818
public let rawValue: UInt
19-
19+
2020
public init(rawValue: UInt) {
2121
self.rawValue = rawValue
2222
}
@@ -26,19 +26,19 @@ extension Parser {
2626
extension Parser.ExperimentalFeatures {
2727
/// Whether to enable the parsing of reference bindings.
2828
public static let referenceBindings = Self (rawValue: 1 << 0)
29-
29+
3030
/// Whether to enable the parsing of 'then' statements.
3131
public static let thenStatements = Self (rawValue: 1 << 1)
32-
32+
3333
/// Whether to enable the parsing of 'do' expressions.
3434
public static let doExpressions = Self (rawValue: 1 << 2)
35-
35+
3636
/// Whether to enable the parsing of NonEscableTypes.
3737
public static let nonescapableTypes = Self (rawValue: 1 << 3)
38-
38+
3939
/// Whether to enable the parsing of trailing comma.
4040
public static let trailingComma = Self (rawValue: 1 << 4)
41-
41+
4242
/// Whether to enable the parsing of SendingArgsAndResults.
4343
public static let sendingArgsAndResults = Self (rawValue: 1 << 5)
4444
}

Sources/SwiftParser/generated/LayoutNodes+Parsable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ fileprivate extension Parser {
383383
}
384384
return node
385385
}
386-
386+
387387
mutating func parseExpression() -> RawExprSyntax {
388388
return self.parseExpression(flavor: .basic, pattern: .none)
389389
}

0 commit comments

Comments
 (0)