@@ -269,6 +269,9 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
269269 /// The path at which SourceKit-LSP can store its index database, aggregating data from `indexStorePath`
270270 public var indexStorePath : String ?
271271
272+ /// Options to control how many targets should be prepared simultaneously by SourceKit-LSP.
273+ public var multiTargetPreparation : MultiTargetPreparationSupport ?
274+
272275 /// Whether the server implements the `buildTarget/outputPaths` request.
273276 public var outputPathsProvider : Bool ?
274277
@@ -278,9 +281,6 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
278281 /// Whether the server implements the `textDocument/sourceKitOptions` request.
279282 public var sourceKitOptionsProvider : Bool ?
280283
281- /// The number of targets to prepare concurrently, when an index request is scheduled.
282- public var indexTaskBatchSize : Int ?
283-
284284 /// The files to watch for changes.
285285 public var watchers : [ FileSystemWatcher ] ?
286286
@@ -289,14 +289,14 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
289289 public init (
290290 indexDatabasePath: String ? = nil ,
291291 indexStorePath: String ? = nil ,
292- indexTaskBatchSize : Int ? = nil ,
292+ multiTargetPreparation : MultiTargetPreparationSupport ? = nil ,
293293 watchers: [ FileSystemWatcher ] ? = nil ,
294294 prepareProvider: Bool ? = nil ,
295295 sourceKitOptionsProvider: Bool ? = nil
296296 ) {
297297 self . indexDatabasePath = indexDatabasePath
298298 self . indexStorePath = indexStorePath
299- self . indexTaskBatchSize = indexTaskBatchSize
299+ self . multiTargetPreparation = multiTargetPreparation
300300 self . watchers = watchers
301301 self . prepareProvider = prepareProvider
302302 self . sourceKitOptionsProvider = sourceKitOptionsProvider
@@ -305,15 +305,15 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
305305 public init (
306306 indexDatabasePath: String ? = nil ,
307307 indexStorePath: String ? = nil ,
308- indexTaskBatchSize : Int ? = nil ,
308+ multiTargetPreparation : MultiTargetPreparationSupport ? = nil ,
309309 outputPathsProvider: Bool ? = nil ,
310310 prepareProvider: Bool ? = nil ,
311311 sourceKitOptionsProvider: Bool ? = nil ,
312312 watchers: [ FileSystemWatcher ] ? = nil
313313 ) {
314314 self . indexDatabasePath = indexDatabasePath
315315 self . indexStorePath = indexStorePath
316- self . indexTaskBatchSize = indexTaskBatchSize
316+ self . multiTargetPreparation = multiTargetPreparation
317317 self . outputPathsProvider = outputPathsProvider
318318 self . prepareProvider = prepareProvider
319319 self . sourceKitOptionsProvider = sourceKitOptionsProvider
@@ -327,8 +327,8 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
327327 if case . string( let indexStorePath) = dictionary [ CodingKeys . indexStorePath. stringValue] {
328328 self . indexStorePath = indexStorePath
329329 }
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 )
332332 }
333333 if case . bool( let outputPathsProvider) = dictionary [ CodingKeys . outputPathsProvider. stringValue] {
334334 self . outputPathsProvider = outputPathsProvider
@@ -352,8 +352,8 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
352352 if let indexStorePath {
353353 result [ CodingKeys . indexStorePath. stringValue] = . string( indexStorePath)
354354 }
355- if let indexTaskBatchSize {
356- result [ CodingKeys . indexTaskBatchSize . stringValue] = . int ( indexTaskBatchSize )
355+ if let multiTargetPreparation {
356+ result [ CodingKeys . multiTargetPreparation . stringValue] = multiTargetPreparation . encodeToLSPAny ( )
357357 }
358358 if let outputPathsProvider {
359359 result [ CodingKeys . outputPathsProvider. stringValue] = . bool( outputPathsProvider)
@@ -370,3 +370,26 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
370370 return . dictionary( result)
371371 }
372372}
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