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 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
- #if compiler(>=6)
14
- public import ArgumentParser
15
13
import BuildSystemIntegration
16
14
import Csourcekitd // Not needed here, but fixes debugging...
17
15
import Diagnose
@@ -26,24 +24,16 @@ import SourceKitLSP
26
24
import SwiftExtensions
27
25
import ToolchainRegistry
28
26
29
- #if canImport(Android)
30
- import Android
31
- #endif
27
+ import struct TSCBasic. AbsolutePath
28
+
29
+ #if compiler(>=6)
30
+ public import ArgumentParser
32
31
#else
33
32
import 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
47
37
#endif
48
38
49
39
extension PathPrefixMapping {
@@ -279,6 +269,10 @@ struct SourceKitLSP: AsyncParsableCommand {
279
269
outFD: realStdoutHandle
280
270
)
281
271
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
+
282
276
var inputMirror : FileHandle ? = nil
283
277
if let inputMirrorDirectory = globalConfigurationOptions. loggingOrDefault. inputMirrorDirectory {
284
278
orLog ( " Setting up input mirror " ) {
You can’t perform that action at this time.
0 commit comments