Query build system of workspaces to determine best workspace to open a file in

This sets the stage for multi-workspace support. Everything should be handled internally, we are just missing the API to actually open multiple workspaces at this point.
This commit is contained in:
Alex Hoppen
2022-04-29 14:33:59 +02:00
parent 22f6b291e1
commit ef8c83fda3
9 changed files with 101 additions and 6 deletions

View File

@@ -187,6 +187,19 @@ extension CompilationDatabaseBuildSystem: BuildSystem {
}
}
}
public func fileHandlingCapability(for uri: DocumentURI) -> FileHandlingCapability {
guard let fileUrl = uri.fileURL else {
return .unhandled
}
return queue.sync {
if database(for: fileUrl) != nil {
return .handled
} else {
return .unhandled
}
}
}
}
extension CompilationDatabaseBuildSystem {