Skip to content

Commit 655da45

Browse files
ahoppenbnbarham
authored andcommitted
Hide internal options from SourceKit-LSP configuration file documentation
(cherry picked from commit 4ec669f)
1 parent 7191e16 commit 655da45

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

Documentation/Configuration File.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ The structure of the file is currently not guaranteed to be stable. Options may
4040
- `indexStorePath: string`: Directory in which a separate compilation stores the index store. By default, inferred from the build system.
4141
- `indexDatabasePath: string`: Directory in which the indexstore-db should be stored. By default, inferred from the build system.
4242
- `indexPrefixMap: [string: string]`: Path remappings for remapping index data for local use.
43-
- `maxCoresPercentageToUseForBackgroundIndexing: number`: A hint indicating how many cores background indexing should use at most (value between 0 and 1). Background indexing is not required to honor this setting.
4443
- `updateIndexStoreTimeout: integer`: Number of seconds to wait for an update index store task to finish before killing it.
4544
- `logging`: Options related to logging, changing SourceKit-LSP’s logging behavior on non-Apple platforms. On Apple platforms, logging is done through the [system log](Diagnose%20Bundle.md#Enable%20Extended%20Logging). These options can only be set globally and not per workspace.
4645
- `level: "debug"|"info"|"default"|"error"|"fault"`: The level from which one onwards log messages should be written.

SourceKitLSPDevUtils/Sources/ConfigSchemaGen/OptionSchema.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ struct OptionSchemaContext {
188188
let name = binding.pattern.trimmed.description
189189
let defaultValue = binding.initializer?.value.description
190190
let description = Self.extractDocComment(variable.leadingTrivia)
191+
if description?.contains("- Note: Internal option") ?? false {
192+
continue
193+
}
191194
let typeInfo = try resolveType(type.type)
192195
properties.append(
193196
.init(name: name, type: typeInfo, description: description, defaultValue: defaultValue)

Sources/SKOptions/SourceKitLSPOptions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
181181
/// Path remappings for remapping index data for local use.
182182
public var indexPrefixMap: [String: String]?
183183
/// A hint indicating how many cores background indexing should use at most (value between 0 and 1). Background indexing is not required to honor this setting.
184+
///
185+
/// - Note: Internal option, may not work as intended
184186
public var maxCoresPercentageToUseForBackgroundIndexing: Double?
185187
/// Number of seconds to wait for an update index store task to finish before killing it.
186188
public var updateIndexStoreTimeout: Int?

config.schema.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@
139139
"markdownDescription" : "Directory in which a separate compilation stores the index store. By default, inferred from the build system.",
140140
"type" : "string"
141141
},
142-
"maxCoresPercentageToUseForBackgroundIndexing" : {
143-
"description" : "A hint indicating how many cores background indexing should use at most (value between 0 and 1). Background indexing is not required to honor this setting.",
144-
"markdownDescription" : "A hint indicating how many cores background indexing should use at most (value between 0 and 1). Background indexing is not required to honor this setting.",
145-
"type" : "number"
146-
},
147142
"updateIndexStoreTimeout" : {
148143
"description" : "Number of seconds to wait for an update index store task to finish before killing it.",
149144
"markdownDescription" : "Number of seconds to wait for an update index store task to finish before killing it.",
@@ -298,4 +293,4 @@
298293
},
299294
"title" : "SourceKit-LSP Configuration",
300295
"type" : "object"
301-
}
296+
}

0 commit comments

Comments
 (0)