Skip to content

Commit 84dfa92

Browse files
committed
Set prioritizeKeepingFunctionOutputTogether in .swift-format
1 parent 94c4b98 commit 84dfa92

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

.swift-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
},
77
"lineBreakBeforeEachArgument": true,
88
"indentConditionalCompilationBlocks": false,
9+
"prioritizeKeepingFunctionOutputTogether": true,
910
"rules": {
1011
"AlwaysUseLowerCamelCase": false,
1112
"AmbiguousTrailingClosureOverload": false,

Sources/SwiftDiagnostics/DiagnosticDecorators/ANSIDiagnosticDecorator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ extension DiagnosticDecorator where Self == ANSIDiagnosticDecorator {
109109
/// ```bash
110110
/// printf "\e[4;39mlet x = 10\e[0;0m\n"
111111
/// ```
112-
@_spi(Testing) public func decorateHighlight(_ highlight: String) -> (
113-
highlightedSourceCode: String, additionalHighlightedLine: String?
114-
) {
112+
@_spi(Testing) public func decorateHighlight(
113+
_ highlight: String
114+
) -> (highlightedSourceCode: String, additionalHighlightedLine: String?) {
115115
(
116116
highlightedSourceCode: colorizeIfNotEmpty(highlight, usingAnnotation: .sourceHighlight),
117117
additionalHighlightedLine: nil

Sources/SwiftDiagnostics/DiagnosticDecorators/BasicDiagnosticDecorator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ extension DiagnosticDecorator where Self == BasicDiagnosticDecorator {
6868
/// - Returns: A tuple containing:
6969
/// - `highlightedSourceCode`: The original text segment.
7070
/// - `additionalHighlightedLine`: Always nil.
71-
@_spi(Testing) public func decorateHighlight(_ highlight: String) -> (
72-
highlightedSourceCode: String, additionalHighlightedLine: String?
73-
) {
71+
@_spi(Testing) public func decorateHighlight(
72+
_ highlight: String
73+
) -> (highlightedSourceCode: String, additionalHighlightedLine: String?) {
7474
return (highlightedSourceCode: highlight, additionalHighlightedLine: nil)
7575
}
7676
}

Sources/SwiftParser/Expressions.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,9 @@ extension Parser {
613613
)
614614
}
615615

616-
mutating func parseDottedExpressionSuffix(previousNode: (some RawSyntaxNodeProtocol)?) -> (
616+
mutating func parseDottedExpressionSuffix(
617+
previousNode: (some RawSyntaxNodeProtocol)?
618+
) -> (
617619
unexpectedPeriod: RawUnexpectedNodesSyntax?,
618620
period: RawTokenSyntax,
619621
declName: RawDeclReferenceExprSyntax,

Sources/SwiftSyntaxMacroExpansion/MacroSystem.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,9 +1133,10 @@ extension MacroApplication {
11331133
/// and expanded accessors, as well as whether any `get`/`set` were
11341134
/// expanded (in which case any initializer on `storage` should be
11351135
/// removed).
1136-
private func expandAccessors(of storage: some DeclSyntaxProtocol, existingAccessors: AccessorBlockSyntax?) -> (
1137-
accessors: AccessorBlockSyntax?, expandsGetSet: Bool
1138-
) {
1136+
private func expandAccessors(
1137+
of storage: some DeclSyntaxProtocol,
1138+
existingAccessors: AccessorBlockSyntax?
1139+
) -> (accessors: AccessorBlockSyntax?, expandsGetSet: Bool) {
11391140
let accessorMacros = macroAttributes(attachedTo: DeclSyntax(storage), ofType: AccessorMacro.Type.self)
11401141

11411142
var newAccessorsBlock = existingAccessors

0 commit comments

Comments
 (0)