Skip to content

Set prioritizeKeepingFunctionOutputTogether in .swift-format #1544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .swift-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"lineBreakBeforeEachArgument": true,
"indentConditionalCompilationBlocks": false,
"prioritizeKeepingFunctionOutputTogether": true,
"rules": {
"AlwaysUseLowerCamelCase": false,
"AmbiguousTrailingClosureOverload": false,
Expand Down
7 changes: 4 additions & 3 deletions Sources/SKTestSupport/MultiFileTestProject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ public class MultiFileTestProject {
/// Opens the document with the given file name in the SourceKit-LSP server.
///
/// - Returns: The URI for the opened document and the positions of the location markers.
public func openDocument(_ fileName: String, language: Language? = nil) throws -> (
uri: DocumentURI, positions: DocumentPositions
) {
public func openDocument(
_ fileName: String,
language: Language? = nil
) throws -> (uri: DocumentURI, positions: DocumentPositions) {
guard let fileData = self.fileData[fileName] else {
throw Error.fileNotFound
}
Expand Down
7 changes: 4 additions & 3 deletions Sources/SemanticIndex/CheckedIndex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,10 @@ private struct IndexOutOfDateChecker {
/// `documentManager` must always be the same between calls to `hasFileInMemoryModifications` since it is not part of
/// the cache key. This is fine because we always assume the `documentManager` to come from the associated value of
/// `CheckLevel.imMemoryModifiedFiles`, which is constant.
private mutating func fileHasInMemoryModifications(_ uri: DocumentURI, documentManager: InMemoryDocumentManager)
-> Bool
{
private mutating func fileHasInMemoryModifications(
_ uri: DocumentURI,
documentManager: InMemoryDocumentManager
) -> Bool {
if let cached = fileHasInMemoryModificationsCache[uri] {
return cached
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/SourceKitLSP/Swift/SyntaxHighlightingTokens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public struct SyntaxHighlightingTokens: Sendable {
}

/// Sorts the tokens in this array by their start position.
public func sorted(_ areInIncreasingOrder: (SyntaxHighlightingToken, SyntaxHighlightingToken) -> Bool)
-> SyntaxHighlightingTokens
{
public func sorted(
_ areInIncreasingOrder: (SyntaxHighlightingToken, SyntaxHighlightingToken) -> Bool
) -> SyntaxHighlightingTokens {
SyntaxHighlightingTokens(tokens: tokens.sorted(by: areInIncreasingOrder))
}
}
Expand Down