Skip to content

Commit 83cb162

Browse files
authored
Merge pull request #1544 from ahoppen/function-output-together
Set `prioritizeKeepingFunctionOutputTogether` in `.swift-format`
2 parents 91c55f9 + f4ea614 commit 83cb162

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

.swift-format

+1
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/SKTestSupport/MultiFileTestProject.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ public class MultiFileTestProject {
137137
/// Opens the document with the given file name in the SourceKit-LSP server.
138138
///
139139
/// - Returns: The URI for the opened document and the positions of the location markers.
140-
public func openDocument(_ fileName: String, language: Language? = nil) throws -> (
141-
uri: DocumentURI, positions: DocumentPositions
142-
) {
140+
public func openDocument(
141+
_ fileName: String,
142+
language: Language? = nil
143+
) throws -> (uri: DocumentURI, positions: DocumentPositions) {
143144
guard let fileData = self.fileData[fileName] else {
144145
throw Error.fileNotFound
145146
}

Sources/SemanticIndex/CheckedIndex.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,10 @@ private struct IndexOutOfDateChecker {
298298
/// `documentManager` must always be the same between calls to `hasFileInMemoryModifications` since it is not part of
299299
/// the cache key. This is fine because we always assume the `documentManager` to come from the associated value of
300300
/// `CheckLevel.imMemoryModifiedFiles`, which is constant.
301-
private mutating func fileHasInMemoryModifications(_ uri: DocumentURI, documentManager: InMemoryDocumentManager)
302-
-> Bool
303-
{
301+
private mutating func fileHasInMemoryModifications(
302+
_ uri: DocumentURI,
303+
documentManager: InMemoryDocumentManager
304+
) -> Bool {
304305
if let cached = fileHasInMemoryModificationsCache[uri] {
305306
return cached
306307
}

Sources/SourceKitLSP/Swift/SyntaxHighlightingTokens.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public struct SyntaxHighlightingTokens: Sendable {
6868
}
6969

7070
/// Sorts the tokens in this array by their start position.
71-
public func sorted(_ areInIncreasingOrder: (SyntaxHighlightingToken, SyntaxHighlightingToken) -> Bool)
72-
-> SyntaxHighlightingTokens
73-
{
71+
public func sorted(
72+
_ areInIncreasingOrder: (SyntaxHighlightingToken, SyntaxHighlightingToken) -> Bool
73+
) -> SyntaxHighlightingTokens {
7474
SyntaxHighlightingTokens(tokens: tokens.sorted(by: areInIncreasingOrder))
7575
}
7676
}

0 commit comments

Comments
 (0)