File tree Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Expand file tree Collapse file tree 1 file changed +12
-18
lines changed Original file line number Diff line number Diff line change 1010//
1111//===----------------------------------------------------------------------===//
1212
13- #if compiler(>=6)
14- public import ArgumentParser
1513import BuildSystemIntegration
1614import Csourcekitd // Not needed here, but fixes debugging...
1715import Diagnose
@@ -26,24 +24,16 @@ import SourceKitLSP
2624import SwiftExtensions
2725import ToolchainRegistry
2826
29- #if canImport(Android)
30- import Android
31- #endif
27+ import struct TSCBasic. AbsolutePath
28+
29+ #if compiler(>=6)
30+ public import ArgumentParser
3231#else
3332import ArgumentParser
34- import BuildSystemIntegration
35- import Csourcekitd // Not needed here, but fixes debugging...
36- import Diagnose
37- import Dispatch
38- import Foundation
39- import LanguageServerProtocol
40- import LanguageServerProtocolExtensions
41- import LanguageServerProtocolJSONRPC
42- import SKLogging
43- import SKOptions
44- import SourceKitLSP
45- import SwiftExtensions
46- import ToolchainRegistry
33+ #endif
34+
35+ #if canImport(Android)
36+ import Android
4737#endif
4838
4939extension PathPrefixMapping {
@@ -279,6 +269,10 @@ struct SourceKitLSP: AsyncParsableCommand {
279269 outFD: realStdoutHandle
280270 )
281271
272+ // For reasons that are completely oblivious to me, `DispatchIO.write`, which is used to write LSP responses to
273+ // stdout fails with error code 5 on Windows unless we call `AbsolutePath(validating:)` on some URL first.
274+ _ = try AbsolutePath ( validating: Bundle . main. bundlePath)
275+
282276 var inputMirror : FileHandle ? = nil
283277 if let inputMirrorDirectory = globalConfigurationOptions. loggingOrDefault. inputMirrorDirectory {
284278 orLog ( " Setting up input mirror " ) {
You can’t perform that action at this time.
0 commit comments