swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
705 stars 47 forks source link

Add action to the command palette to re-index a project #939

Open ahoppen opened 3 days ago

ahoppen commented 3 days ago

https://github.com/swiftlang/sourcekit-lsp/pull/1507 added a workspace/triggerReindex request to SourceKit-LSP, which re-indexes a project in SourceKit-LSP if background indexing is enabled.

The request is not intended to be something that users invoke regularly but it is useful as a workaround should SourceKit-LSP’s index up-to-date tracker get out of sync with the project state (which we know can happen in some situations like https://github.com/apple/sourcekit-lsp/issues/1264). The workflow should thus be as follow: