Skip to content

Commit 1727a7b

Browse files
committed
Remove options to override the index store path and index database path
We should always infer these from the build system and I can’t think of a reason to override these settings.
1 parent b3a73f6 commit 1727a7b

File tree

4 files changed

+3
-36
lines changed

4 files changed

+3
-36
lines changed

Sources/SKOptions/SourceKitLSPOptions.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
182182
}
183183

184184
public struct IndexOptions: Sendable, Codable, Equatable {
185-
/// Directory in which a separate compilation stores the index store. By default, inferred from the build system.
186-
public var indexStorePath: String?
187-
/// Directory in which the indexstore-db should be stored. By default, inferred from the build system.
188-
public var indexDatabasePath: String?
189185
/// Path remappings for remapping index data for local use.
190186
public var indexPrefixMap: [String: String]?
191187
/// 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.
@@ -208,23 +204,17 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
208204
}
209205

210206
public init(
211-
indexStorePath: String? = nil,
212-
indexDatabasePath: String? = nil,
213207
indexPrefixMap: [String: String]? = nil,
214208
maxCoresPercentageToUseForBackgroundIndexing: Double? = nil,
215209
updateIndexStoreTimeout: Int? = nil
216210
) {
217-
self.indexStorePath = indexStorePath
218-
self.indexDatabasePath = indexDatabasePath
219211
self.indexPrefixMap = indexPrefixMap
220212
self.maxCoresPercentageToUseForBackgroundIndexing = maxCoresPercentageToUseForBackgroundIndexing
221213
self.updateIndexStoreTimeout = updateIndexStoreTimeout
222214
}
223215

224216
static func merging(base: IndexOptions, override: IndexOptions?) -> IndexOptions {
225217
return IndexOptions(
226-
indexStorePath: override?.indexStorePath ?? base.indexStorePath,
227-
indexDatabasePath: override?.indexDatabasePath ?? base.indexDatabasePath,
228218
indexPrefixMap: override?.indexPrefixMap ?? base.indexPrefixMap,
229219
maxCoresPercentageToUseForBackgroundIndexing: override?.maxCoresPercentageToUseForBackgroundIndexing
230220
?? base.maxCoresPercentageToUseForBackgroundIndexing,

Sources/SKTestSupport/IndexedSingleSwiftFileTestProject.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,8 @@ package struct IndexedSingleSwiftFileTestProject {
147147
}
148148

149149
// Create the test client
150-
var options = try await SourceKitLSPOptions.testDefault()
151-
options.indexOrDefault = SourceKitLSPOptions.IndexOptions(
152-
indexStorePath: try indexURL.filePath,
153-
indexDatabasePath: try indexDBURL.filePath
154-
)
155150
self.testClient = try await TestSourceKitLSPClient(
156-
options: options,
151+
options: try await SourceKitLSPOptions.testDefault(),
157152
capabilities: capabilities,
158153
workspaceFolders: [
159154
WorkspaceFolder(uri: DocumentURI(testWorkspaceDirectory))

Sources/SourceKitLSP/Workspace.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,17 +272,13 @@ package final class Workspace: Sendable, BuildSystemManagerDelegate {
272272

273273
let indexOptions = options.indexOrDefault
274274
let indexStorePath: URL? =
275-
if let indexStorePath = indexOptions.indexStorePath {
276-
URL(fileURLWithPath: indexStorePath, relativeTo: rootUri?.fileURL)
277-
} else if let indexStorePath = await buildSystemManager.initializationData?.indexStorePath {
275+
if let indexStorePath = await buildSystemManager.initializationData?.indexStorePath {
278276
URL(fileURLWithPath: indexStorePath, relativeTo: rootUri?.fileURL)
279277
} else {
280278
nil
281279
}
282280
let indexDatabasePath: URL? =
283-
if let indexDatabasePath = indexOptions.indexDatabasePath {
284-
URL(fileURLWithPath: indexDatabasePath, relativeTo: rootUri?.fileURL)
285-
} else if let indexDatabasePath = await buildSystemManager.initializationData?.indexDatabasePath {
281+
if let indexDatabasePath = await buildSystemManager.initializationData?.indexDatabasePath {
286282
URL(fileURLWithPath: indexDatabasePath, relativeTo: rootUri?.fileURL)
287283
} else {
288284
nil

Sources/sourcekit-lsp/SourceKitLSP.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,6 @@ struct SourceKitLSP: AsyncParsableCommand {
112112
)
113113
var clangdOptions = [String]()
114114

115-
@Option(
116-
name: .customLong("index-store-path", withSingleDash: true),
117-
help: "Override index-store-path from the build system"
118-
)
119-
var indexStorePath: String?
120-
121-
@Option(
122-
name: .customLong("index-db-path", withSingleDash: true),
123-
help: "Override index-database-path from the build system"
124-
)
125-
var indexDatabasePath: String?
126-
127115
@Option(
128116
name: .customLong("index-prefix-map", withSingleDash: true),
129117
parsing: .unconditionalSingleValue,
@@ -177,8 +165,6 @@ struct SourceKitLSP: AsyncParsableCommand {
177165
compilationDatabase: SourceKitLSPOptions.CompilationDatabaseOptions(searchPaths: compilationDatabaseSearchPaths),
178166
clangdOptions: clangdOptions,
179167
index: SourceKitLSPOptions.IndexOptions(
180-
indexStorePath: indexStorePath,
181-
indexDatabasePath: indexDatabasePath,
182168
indexPrefixMap: [String: String](
183169
indexPrefixMappings.map { ($0.original, $0.replacement) },
184170
uniquingKeysWith: { lhs, rhs in rhs }

0 commit comments

Comments
 (0)