From 75c70d9c5a357e4888a52f76ae8df45a454fd403 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Fri, 6 Sep 2024 13:00:07 -0700 Subject: [PATCH] Decode a few keys in `SourceKitLSPOptions` that we missed before MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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`. --- Sources/SKCore/SourceKitLSPOptions.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/SKCore/SourceKitLSPOptions.swift b/Sources/SKCore/SourceKitLSPOptions.swift index 953c0feab..6c36a9fe6 100644 --- a/Sources/SKCore/SourceKitLSPOptions.swift +++ b/Sources/SKCore/SourceKitLSPOptions.swift @@ -379,6 +379,10 @@ public struct SourceKitLSPOptions: Sendable, Codable { ) self.generatedFilesPath = try container.decodeIfPresent(String.self, forKey: CodingKeys.generatedFilesPath) self.backgroundIndexing = try container.decodeIfPresent(Bool.self, forKey: CodingKeys.backgroundIndexing) + self.backgroundPreparationMode = try container.decodeIfPresent( + String.self, + forKey: CodingKeys.backgroundPreparationMode + ) self.experimentalFeatures = try container.decodeIfPresent( Set.self, forKey: CodingKeys.experimentalFeatures @@ -391,5 +395,9 @@ public struct SourceKitLSPOptions: Sendable, Codable { Double.self, forKey: CodingKeys.workDoneProgressDebounceDuration ) + self.sourcekitdRequestTimeout = try container.decodeIfPresent( + Double.self, + forKey: CodingKeys.sourcekitdRequestTimeout + ) } }