mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Merge pull request #179 from rmaz/indexdbpath
Set index db path from build server response
This commit is contained in:
@@ -31,6 +31,8 @@ public final class BuildServerBuildSystem {
|
||||
|
||||
var handler: BuildServerHandler?
|
||||
var buildServer: JSONRPCConection?
|
||||
|
||||
public private(set) var indexDatabasePath: AbsolutePath?
|
||||
public private(set) var indexStorePath: AbsolutePath?
|
||||
|
||||
/// Delegate to handle any build system events.
|
||||
@@ -104,6 +106,9 @@ public final class BuildServerBuildSystem {
|
||||
log("initialized build server \(response.displayName)")
|
||||
|
||||
// see if index store was set as part of the server metadata
|
||||
if let indexDbPath = readReponseDataKey(data: response.data, key: "indexDatabasePath") {
|
||||
self.indexDatabasePath = AbsolutePath(indexDbPath, relativeTo: self.projectRoot)
|
||||
}
|
||||
if let indexStorePath = readReponseDataKey(data: response.data, key: "indexStorePath") {
|
||||
self.indexStorePath = AbsolutePath(indexStorePath, relativeTo: self.projectRoot)
|
||||
}
|
||||
@@ -164,10 +169,6 @@ extension BuildServerBuildSystem: BuildSystem {
|
||||
})
|
||||
}
|
||||
|
||||
public var indexDatabasePath: AbsolutePath? {
|
||||
return buildFolder?.appending(components: "index", "db")
|
||||
}
|
||||
|
||||
public func settings(for url: URL, _ language: Language) -> FileBuildSettings? {
|
||||
if let response = try? self.buildServer?.sendSync(SourceKitOptions(uri: url)) {
|
||||
return FileBuildSettings(compilerArguments: response.options, workingDirectory: response.workingDirectory)
|
||||
|
||||
Reference in New Issue
Block a user