Support index store path remappings (#562)

This allows sourcekit-lsp to make use of the path remappings recently added to
the index store and IndexStoreDB to remap remote paths into local paths
when loading index data locally.

These remappings can be provided via the `-index-prefix-map` command line flag to sourcekit-lsp or via the `BuildSystem` integration point.

(cherry picked from commit 472a06c88a)
This commit is contained in:
David Goldman
2022-06-09 10:45:52 -04:00
parent 9872634508
commit c94b0d058c
12 changed files with 63 additions and 2 deletions

View File

@@ -88,6 +88,8 @@ extension CompilationDatabaseBuildSystem: BuildSystem {
indexStorePath?.parentDirectory.appending(component: "IndexDatabase")
}
public var indexPrefixMappings: [PathPrefixMapping] { return [] }
public func registerForChangeNotifications(for uri: DocumentURI, language: Language) {
queue.async {
self.watchedFiles[uri] = language