@@ -44,12 +44,6 @@ public final class TestSourceKitLSPClient: MessageHandler {
44
44
/// `nonisolated(unsafe)` is fine because `nextRequestID` is atomic.
45
45
private nonisolated ( unsafe) var nextRequestID = AtomicUInt32 ( initialValue: 0 )
46
46
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
-
53
47
/// The server that handles the requests.
54
48
public let server : SourceKitLSPServer
55
49
@@ -102,7 +96,6 @@ public final class TestSourceKitLSPClient: MessageHandler {
102
96
/// needed.
103
97
public init (
104
98
serverOptions: SourceKitLSPServer . Options = . testDefault,
105
- useGlobalModuleCache: Bool = true ,
106
99
initialize: Bool = true ,
107
100
initializationOptions: LSPAny ? = nil ,
108
101
capabilities: ClientCapabilities = ClientCapabilities ( ) ,
@@ -112,14 +105,9 @@ public final class TestSourceKitLSPClient: MessageHandler {
112
105
preInitialization: ( ( TestSourceKitLSPClient ) -> Void ) ? = nil ,
113
106
cleanUp: @Sendable @escaping ( ) -> Void = { }
114
107
) async throws {
115
- if !useGlobalModuleCache {
116
- moduleCache = URL ( fileURLWithPath: NSTemporaryDirectory ( ) ) . appendingPathComponent ( UUID ( ) . uuidString)
117
- } else {
118
- moduleCache = nil
119
- }
120
108
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]
123
111
}
124
112
if enableBackgroundIndexing {
125
113
serverOptions. experimentalFeatures. append ( . backgroundIndexing)
@@ -191,9 +179,6 @@ public final class TestSourceKitLSPClient: MessageHandler {
191
179
sema. wait ( )
192
180
self . send ( ExitNotification ( ) )
193
181
194
- if let moduleCache {
195
- try ? FileManager . default. removeItem ( at: moduleCache)
196
- }
197
182
cleanUp ( )
198
183
}
199
184
0 commit comments