Skip to content

Commit eec5455

Browse files
committed
Add a command-line option to enable background indexing
This allows me to test background indexing more easily locally as it matures. It is still experimental and may contain bugs. Fixes #1256 rdar://127474761
1 parent 1fb087f commit eec5455

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/sourcekit-lsp/SourceKitLSP.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ struct SourceKitLSP: AsyncParsableCommand {
200200
)
201201
var completionMaxResults = 200
202202

203+
@Flag(
204+
help: "Enable background indexing. This feature is still under active development and may be incomplete."
205+
)
206+
var enableExperimentalBackgroundIndexing = false
207+
203208
func mapOptions() -> SourceKitLSPServer.Options {
204209
var serverOptions = SourceKitLSPServer.Options()
205210

@@ -215,6 +220,7 @@ struct SourceKitLSP: AsyncParsableCommand {
215220
serverOptions.indexOptions.indexStorePath = indexStorePath
216221
serverOptions.indexOptions.indexDatabasePath = indexDatabasePath
217222
serverOptions.indexOptions.indexPrefixMappings = indexPrefixMappings
223+
serverOptions.indexOptions.enableBackgroundIndexing = enableExperimentalBackgroundIndexing
218224
serverOptions.completionOptions.maxResults = completionMaxResults
219225
serverOptions.generatedInterfacesPath = generatedInterfacesPath
220226

0 commit comments

Comments
 (0)