@@ -242,6 +242,26 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
242242 }
243243 }
244244
245+ public struct SourceKitDOptions : Sendable , Codable , Equatable {
246+ /// When set, load the SourceKit client plugin from this path instead of locating it inside the toolchain.
247+ public var clientPlugin : String ?
248+
249+ /// When set, load the SourceKit service plugin from this path instead of locating it inside the toolchain.
250+ public var servicePlugin : String ?
251+
252+ public init ( clientPlugin: String ? = nil , servicePlugin: String ? = nil ) {
253+ self . clientPlugin = clientPlugin
254+ self . servicePlugin = servicePlugin
255+ }
256+
257+ static func merging( base: SourceKitDOptions , override: SourceKitDOptions ? ) -> SourceKitDOptions {
258+ return SourceKitDOptions (
259+ clientPlugin: override? . clientPlugin ?? base. clientPlugin,
260+ servicePlugin: override? . servicePlugin ?? base. servicePlugin
261+ )
262+ }
263+ }
264+
245265 public enum BackgroundPreparationMode : String , Sendable , Codable , Equatable {
246266 /// Build a target to prepare it.
247267 case build
@@ -303,6 +323,13 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
303323 set { logging = newValue }
304324 }
305325
326+ /// Options modifying the behavior of sourcekitd.
327+ private var sourcekitd : SourceKitDOptions ?
328+ public var sourcekitdOrDefault : SourceKitDOptions {
329+ get { sourcekitd ?? . init( ) }
330+ set { sourcekitd = newValue }
331+ }
332+
306333 /// Default workspace type. Overrides workspace type selection logic.
307334 public var defaultWorkspaceType : WorkspaceType ?
308335 /// Directory in which generated interfaces and macro expansions should be stored.
@@ -381,6 +408,7 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
381408 clangdOptions: [ String ] ? = nil ,
382409 index: IndexOptions ? = . init( ) ,
383410 logging: LoggingOptions ? = . init( ) ,
411+ sourcekitd: SourceKitDOptions ? = . init( ) ,
384412 defaultWorkspaceType: WorkspaceType ? = nil ,
385413 generatedFilesPath: String ? = nil ,
386414 backgroundIndexing: Bool ? = nil ,
@@ -398,6 +426,7 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
398426 self . clangdOptions = clangdOptions
399427 self . index = index
400428 self . logging = logging
429+ self . sourcekitd = sourcekitd
401430 self . generatedFilesPath = generatedFilesPath
402431 self . defaultWorkspaceType = defaultWorkspaceType
403432 self . backgroundIndexing = backgroundIndexing
@@ -454,6 +483,7 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
454483 clangdOptions: override? . clangdOptions ?? base. clangdOptions,
455484 index: IndexOptions . merging ( base: base. indexOrDefault, override: override? . index) ,
456485 logging: LoggingOptions . merging ( base: base. loggingOrDefault, override: override? . logging) ,
486+ sourcekitd: SourceKitDOptions . merging ( base: base. sourcekitdOrDefault, override: override? . sourcekitd) ,
457487 defaultWorkspaceType: override? . defaultWorkspaceType ?? base. defaultWorkspaceType,
458488 generatedFilesPath: override? . generatedFilesPath ?? base. generatedFilesPath,
459489 backgroundIndexing: override? . backgroundIndexing ?? base. backgroundIndexing,
0 commit comments