@@ -269,6 +269,9 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
269
269
/// The path at which SourceKit-LSP can store its index database, aggregating data from `indexStorePath`
270
270
public var indexStorePath : String ?
271
271
272
+ /// Options to control how many targets should be prepared simultaneously by SourceKit-LSP.
273
+ public var multiTargetPreparation : MultiTargetPreparationSupport ?
274
+
272
275
/// Whether the server implements the `buildTarget/outputPaths` request.
273
276
public var outputPathsProvider : Bool ?
274
277
@@ -278,9 +281,6 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
278
281
/// Whether the server implements the `textDocument/sourceKitOptions` request.
279
282
public var sourceKitOptionsProvider : Bool ?
280
283
281
- /// The number of targets to prepare concurrently, when an index request is scheduled.
282
- public var indexTaskBatchSize : Int ?
283
-
284
284
/// The files to watch for changes.
285
285
public var watchers : [ FileSystemWatcher ] ?
286
286
@@ -289,14 +289,14 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
289
289
public init (
290
290
indexDatabasePath: String ? = nil ,
291
291
indexStorePath: String ? = nil ,
292
- indexTaskBatchSize : Int ? = nil ,
292
+ multiTargetPreparation : MultiTargetPreparationSupport ? = nil ,
293
293
watchers: [ FileSystemWatcher ] ? = nil ,
294
294
prepareProvider: Bool ? = nil ,
295
295
sourceKitOptionsProvider: Bool ? = nil
296
296
) {
297
297
self . indexDatabasePath = indexDatabasePath
298
298
self . indexStorePath = indexStorePath
299
- self . indexTaskBatchSize = indexTaskBatchSize
299
+ self . multiTargetPreparation = multiTargetPreparation
300
300
self . watchers = watchers
301
301
self . prepareProvider = prepareProvider
302
302
self . sourceKitOptionsProvider = sourceKitOptionsProvider
@@ -305,15 +305,15 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
305
305
public init (
306
306
indexDatabasePath: String ? = nil ,
307
307
indexStorePath: String ? = nil ,
308
- indexTaskBatchSize : Int ? = nil ,
308
+ multiTargetPreparation : MultiTargetPreparationSupport ? = nil ,
309
309
outputPathsProvider: Bool ? = nil ,
310
310
prepareProvider: Bool ? = nil ,
311
311
sourceKitOptionsProvider: Bool ? = nil ,
312
312
watchers: [ FileSystemWatcher ] ? = nil
313
313
) {
314
314
self . indexDatabasePath = indexDatabasePath
315
315
self . indexStorePath = indexStorePath
316
- self . indexTaskBatchSize = indexTaskBatchSize
316
+ self . multiTargetPreparation = multiTargetPreparation
317
317
self . outputPathsProvider = outputPathsProvider
318
318
self . prepareProvider = prepareProvider
319
319
self . sourceKitOptionsProvider = sourceKitOptionsProvider
@@ -327,8 +327,8 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
327
327
if case . string( let indexStorePath) = dictionary [ CodingKeys . indexStorePath. stringValue] {
328
328
self . indexStorePath = indexStorePath
329
329
}
330
- if case . int ( let indexTaskBatchSize ) = dictionary [ CodingKeys . indexTaskBatchSize . stringValue] {
331
- self . indexTaskBatchSize = indexTaskBatchSize
330
+ if case . dictionary ( let multiTargetPreparation ) = dictionary [ CodingKeys . multiTargetPreparation . stringValue] {
331
+ self . multiTargetPreparation = MultiTargetPreparationSupport ( fromLSPDictionary : multiTargetPreparation )
332
332
}
333
333
if case . bool( let outputPathsProvider) = dictionary [ CodingKeys . outputPathsProvider. stringValue] {
334
334
self . outputPathsProvider = outputPathsProvider
@@ -352,8 +352,8 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
352
352
if let indexStorePath {
353
353
result [ CodingKeys . indexStorePath. stringValue] = . string( indexStorePath)
354
354
}
355
- if let indexTaskBatchSize {
356
- result [ CodingKeys . indexTaskBatchSize . stringValue] = . int ( indexTaskBatchSize )
355
+ if let multiTargetPreparation {
356
+ result [ CodingKeys . multiTargetPreparation . stringValue] = multiTargetPreparation . encodeToLSPAny ( )
357
357
}
358
358
if let outputPathsProvider {
359
359
result [ CodingKeys . outputPathsProvider. stringValue] = . bool( outputPathsProvider)
@@ -370,3 +370,26 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
370
370
return . dictionary( result)
371
371
}
372
372
}
373
+
374
+ public struct MultiTargetPreparationSupport : LSPAnyCodable , Codable , Sendable {
375
+ /// Whether the build server can prepare multiple targets in parallel. If this value is omitted, it is assumed to be `true`.
376
+ public var supported : Bool ?
377
+
378
+ public init ( supported: Bool ? = nil ) {
379
+ self . supported = supported
380
+ }
381
+
382
+ public init ? ( fromLSPDictionary dictionary: [ String : LanguageServerProtocol . LSPAny ] ) {
383
+ if case . bool( let supported) = dictionary [ CodingKeys . supported. stringValue] {
384
+ self . supported = supported
385
+ }
386
+ }
387
+
388
+ public func encodeToLSPAny( ) -> LanguageServerProtocol . LSPAny {
389
+ var result : [ String : LSPAny ] = [ : ]
390
+ if let supported {
391
+ result [ CodingKeys . supported. stringValue] = . bool( supported)
392
+ }
393
+ return . dictionary( result)
394
+ }
395
+ }
0 commit comments