Skip to content

Commit 4ec669f

Browse files
committed
Hide internal options from SourceKit-LSP configuration file documentation
1 parent 03da7e9 commit 4ec669f

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

Documentation/Configuration File.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ The structure of the file is currently not guaranteed to be stable. Options may
3838
- `indexStorePath: string`: Directory in which a separate compilation stores the index store. By default, inferred from the build system.
3939
- `indexDatabasePath: string`: Directory in which the indexstore-db should be stored. By default, inferred from the build system.
4040
- `indexPrefixMap: [string: string]`: Path remappings for remapping index data for local use.
41-
- `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.
4241
- `updateIndexStoreTimeout: integer`: Number of seconds to wait for an update index store task to finish before killing it.
4342
- `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.
4443
- `level: "debug"|"info"|"default"|"error"|"fault"`: The level from which one onwards log messages should be written.
4544
- `privacyLevel: "public"|"private"|"sensitive"`: Whether potentially sensitive information should be redacted. Default is `public`, which redacts potentially sensitive information.
4645
- `inputMirrorDirectory: string`: Write all input received by SourceKit-LSP on stdin to a file in this directory. Useful to record and replay an entire SourceKit-LSP session.
4746
- `outputMirrorDirectory: string`: Write all data sent from SourceKit-LSP to the client to a file in this directory. Useful to record the raw communication between SourceKit-LSP and the client on a low level.
4847
- `sourcekitd`: Options modifying the behavior of sourcekitd.
49-
- `clientPlugin: string`: When set, load the SourceKit client plugin from this path instead of locating it inside the toolchain.
50-
- `servicePlugin: string`: When set, load the SourceKit service plugin from this path instead of locating it inside the toolchain.
5148
- `defaultWorkspaceType: "buildServer"|"compilationDatabase"|"swiftPM"`: Default workspace type. Overrides workspace type selection logic.
5249
- `generatedFilesPath: string`: Directory in which generated interfaces and macro expansions should be stored.
5350
- `backgroundIndexing: boolean`: Whether background indexing is enabled.

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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
168168
/// Path remappings for remapping index data for local use.
169169
public var indexPrefixMap: [String: String]?
170170
/// 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.
171+
///
172+
/// - Note: Internal option, may not work as intended
171173
public var maxCoresPercentageToUseForBackgroundIndexing: Double?
172174
/// Number of seconds to wait for an update index store task to finish before killing it.
173175
public var updateIndexStoreTimeout: Int?
@@ -252,9 +254,13 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
252254

253255
public struct SourceKitDOptions: Sendable, Codable, Equatable {
254256
/// When set, load the SourceKit client plugin from this path instead of locating it inside the toolchain.
257+
///
258+
/// - Note: Internal option, only to be used while running SourceKit-LSP tests
255259
public var clientPlugin: String?
256260

257261
/// When set, load the SourceKit service plugin from this path instead of locating it inside the toolchain.
262+
///
263+
/// - Note: Internal option, only to be used while running SourceKit-LSP tests
258264
public var servicePlugin: String?
259265

260266
public init(clientPlugin: String? = nil, servicePlugin: String? = nil) {

config.schema.json

Lines changed: 0 additions & 17 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.",
@@ -194,18 +189,6 @@
194189
"sourcekitd" : {
195190
"description" : "Options modifying the behavior of sourcekitd.",
196191
"markdownDescription" : "Options modifying the behavior of sourcekitd.",
197-
"properties" : {
198-
"clientPlugin" : {
199-
"description" : "When set, load the SourceKit client plugin from this path instead of locating it inside the toolchain.",
200-
"markdownDescription" : "When set, load the SourceKit client plugin from this path instead of locating it inside the toolchain.",
201-
"type" : "string"
202-
},
203-
"servicePlugin" : {
204-
"description" : "When set, load the SourceKit service plugin from this path instead of locating it inside the toolchain.",
205-
"markdownDescription" : "When set, load the SourceKit service plugin from this path instead of locating it inside the toolchain.",
206-
"type" : "string"
207-
}
208-
},
209192
"type" : "object"
210193
},
211194
"sourcekitdRequestTimeout" : {

0 commit comments

Comments
 (0)