@@ -44,12 +44,6 @@ public final class TestSourceKitLSPClient: MessageHandler {
4444 /// `nonisolated(unsafe)` is fine because `nextRequestID` is atomic.
4545 private nonisolated ( unsafe) var nextRequestID = AtomicUInt32 ( initialValue: 0 )
4646
47- /// If the server is not using the global module cache, the path of the local
48- /// module cache.
49- ///
50- /// This module cache will be deleted when the test server is destroyed.
51- private let moduleCache : URL ?
52-
5347 /// The server that handles the requests.
5448 public let server : SourceKitLSPServer
5549
@@ -102,7 +96,6 @@ public final class TestSourceKitLSPClient: MessageHandler {
10296 /// needed.
10397 public init (
10498 serverOptions: SourceKitLSPServer . Options = . testDefault,
105- useGlobalModuleCache: Bool = true ,
10699 initialize: Bool = true ,
107100 initializationOptions: LSPAny ? = nil ,
108101 capabilities: ClientCapabilities = ClientCapabilities ( ) ,
@@ -112,14 +105,9 @@ public final class TestSourceKitLSPClient: MessageHandler {
112105 preInitialization: ( ( TestSourceKitLSPClient ) -> Void ) ? = nil ,
113106 cleanUp: @Sendable @escaping ( ) -> Void = { }
114107 ) async throws {
115- if !useGlobalModuleCache {
116- moduleCache = URL ( fileURLWithPath: NSTemporaryDirectory ( ) ) . appendingPathComponent ( UUID ( ) . uuidString)
117- } else {
118- moduleCache = nil
119- }
120108 var serverOptions = serverOptions
121- if let moduleCache {
122- serverOptions. buildSetup. flags. swiftCompilerFlags += [ " -module-cache-path " , moduleCache . path]
109+ if let globalModuleCache {
110+ serverOptions. buildSetup. flags. swiftCompilerFlags += [ " -module-cache-path " , globalModuleCache . path]
123111 }
124112 if enableBackgroundIndexing {
125113 serverOptions. experimentalFeatures. append ( . backgroundIndexing)
@@ -191,9 +179,6 @@ public final class TestSourceKitLSPClient: MessageHandler {
191179 sema. wait ( )
192180 self . send ( ExitNotification ( ) )
193181
194- if let moduleCache {
195- try ? FileManager . default. removeItem ( at: moduleCache)
196- }
197182 cleanUp ( )
198183 }
199184
0 commit comments