swiftlang/vscode-swift

Add setting to enable experimental background indexing in SourceKit-LSP

Closed this issue · 4 comments

Could you add a setting that allows background indexing to be enabled? Something like


Experimental: Background Indexing

Enable SourceKit-LSP’s experimental background indexing for SwiftPM projects, providing cross-file functionality without needing to build. This requires SourceKit-LSP bundled with Swift 6.


When enabled, send the following in the initializationOptions of the initialize request.

{
  "backgroundIndexing": true,
  "backgroundPreparationMode": "enabled"
}

@ahoppen is this functionally equivalent to passing --experimental-feature background-indexing as arguments to the LSP?

Passing --experimental-feature background-indexing as the command line argument to sourcekit-lsp has the same behavior as "backgroundIndexing": true. We prefer to use the initialization options now because it allows us to remove options. Removing a command line option would cause SourceKit-jLPS to fail to launch.

Fixed in #992

Verified with d6c91dd