From 698b384a8bb91cee6ee27b50c1e219a8d0d6c50e Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 6 Mar 2025 22:53:26 -0800 Subject: [PATCH] Add `-` to `swift-format` invocation to indicate that file contents should be read from stdin To match https://github.com/swiftlang/swift-format/pull/914 --- Sources/SourceKitLSP/Swift/DocumentFormatting.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/SourceKitLSP/Swift/DocumentFormatting.swift b/Sources/SourceKitLSP/Swift/DocumentFormatting.swift index 8296dcd59..872f25422 100644 --- a/Sources/SourceKitLSP/Swift/DocumentFormatting.swift +++ b/Sources/SourceKitLSP/Swift/DocumentFormatting.swift @@ -190,6 +190,7 @@ extension SwiftLanguageService { var args = try [ swiftFormat.filePath, "format", + "-", // Read file contents from stdin "--configuration", swiftFormatConfiguration(for: textDocument.uri, options: options), ]