Skip to content

Commit 75c70d9

Browse files
committed
Decode a few keys in SourceKitLSPOptions that we missed before
We forgot to decode the following keys in the custom decode function, which meant that you couldn’t set them using SourceKit-LSP’s `config.json` file. - `backgroundPreparationMode` - `sourcekitdRequestTimeout` In particular this meant that you couldn’t enable the `--experimental-prepare-for-indexing` preparation mode. Add the necessary decoding functions in `release/6.0` and eliminate the custom decode logic entirely in `main`.
1 parent 480bb0c commit 75c70d9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/SKCore/SourceKitLSPOptions.swift

+8
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ public struct SourceKitLSPOptions: Sendable, Codable {
379379
)
380380
self.generatedFilesPath = try container.decodeIfPresent(String.self, forKey: CodingKeys.generatedFilesPath)
381381
self.backgroundIndexing = try container.decodeIfPresent(Bool.self, forKey: CodingKeys.backgroundIndexing)
382+
self.backgroundPreparationMode = try container.decodeIfPresent(
383+
String.self,
384+
forKey: CodingKeys.backgroundPreparationMode
385+
)
382386
self.experimentalFeatures = try container.decodeIfPresent(
383387
Set<ExperimentalFeature>.self,
384388
forKey: CodingKeys.experimentalFeatures
@@ -391,5 +395,9 @@ public struct SourceKitLSPOptions: Sendable, Codable {
391395
Double.self,
392396
forKey: CodingKeys.workDoneProgressDebounceDuration
393397
)
398+
self.sourcekitdRequestTimeout = try container.decodeIfPresent(
399+
Double.self,
400+
forKey: CodingKeys.sourcekitdRequestTimeout
401+
)
394402
}
395403
}

0 commit comments

Comments
 (0)