Skip to content

Commit a61079c

Browse files
committed
Default multi-target preparation to true
1 parent 8da0ff7 commit a61079c

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

Contributor Documentation/BSP Extensions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ export interface SourceKitInitializeBuildResponseData {
4141
}
4242

4343
export interface MultiTargetPreparationSupport {
44-
/** Whether the build server can prepare multiple targets in parallel. */
45-
supported: bool;
44+
/** Whether the build server can prepare multiple targets in parallel.
45+
* If this value is not provided, it will be assumed to be `true`. */
46+
supported?: bool;
4647

4748
/** The number of targets to prepare in parallel.
4849
* If not provided, SourceKit-LSP will calculate an appropriate value based on the environment. */

Sources/BuildServerIntegration/FixedCompilationDatabaseBuildServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ package actor FixedCompilationDatabaseBuildServer: BuiltInBuildServer {
5959
indexStorePath?.deletingLastPathComponent().appendingPathComponent("IndexDatabase")
6060
}
6161

62-
package nonisolated var supportsMultiTargetPreparation: Bool { false }
62+
package nonisolated var supportsMultiTargetPreparation: Bool { true }
6363

6464
package nonisolated var supportsPreparationAndOutputPaths: Bool { false }
6565

Sources/BuildServerIntegration/JSONCompilationDatabaseBuildServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ package actor JSONCompilationDatabaseBuildServer: BuiltInBuildServer {
9696
indexStorePath?.deletingLastPathComponent().appendingPathComponent("IndexDatabase")
9797
}
9898

99-
package nonisolated var supportsMultiTargetPreparation: Bool { false }
99+
package nonisolated var supportsMultiTargetPreparation: Bool { true }
100100

101101
package nonisolated var supportsPreparationAndOutputPaths: Bool { false }
102102

Sources/BuildServerIntegration/LegacyBuildServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ actor LegacyBuildServer: MessageHandler, BuiltInBuildServer {
138138
connectionToSourceKitLSP.send(OnBuildTargetDidChangeNotification(changes: nil))
139139
}
140140

141-
package nonisolated var supportsMultiTargetPreparation: Bool { false }
141+
package nonisolated var supportsMultiTargetPreparation: Bool { true }
142142

143143
package nonisolated var supportsPreparationAndOutputPaths: Bool { false }
144144

Sources/BuildServerProtocol/Messages/InitializeBuildRequest.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ public struct SourceKitInitializeBuildResponseData: LSPAnyCodable, Codable, Send
373373

374374
public struct MultiTargetPreparationSupport: LSPAnyCodable, Codable, Sendable {
375375
/// Whether the build server can prepare multiple targets in parallel.
376+
/// If this value is not provided, it will be assumed to be `true`.
376377
public var supported: Bool?
377378

378379
/// The number of targets to prepare in parallel.

Sources/SourceKitLSP/Workspace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ package final class Workspace: Sendable, BuildServerManagerDelegate {
162162
if options.backgroundIndexingOrDefault, let uncheckedIndex,
163163
await buildServerManager.initializationData?.prepareProvider ?? false
164164
{
165-
let shouldIndexInParallel = await buildServerManager.initializationData?.multiTargetPreparation?.supported ?? false
165+
let shouldIndexInParallel = await buildServerManager.initializationData?.multiTargetPreparation?.supported ?? true
166166
let batchSize: Int
167167
if shouldIndexInParallel {
168168
if let customBatchSize = await buildServerManager.initializationData?.multiTargetPreparation?.batchSize {

0 commit comments

Comments
 (0)