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

@@ -14,6 +14,18 @@ import BuildServerProtocol
import LanguageServerProtocol
import TSCBasic
/// Defines how well a `BuildSystem` can handle a file with a given URI.
public enum FileHandlingCapability: Comparable {
/// The build system can't handle the file at all
case unhandled
/// The build system has fallback build settings for the file
case fallback
/// The build system knows how to handle the file
case handled
}
/// Provider of FileBuildSettings and other build-related information.
///
/// The primary role of the build system is to answer queries for
@@ -62,6 +74,8 @@ public protocol BuildSystem: AnyObject {
/// Called when files in the project change.
func filesDidChange(_ events: [FileEvent])
func fileHandlingCapability(for uri: DocumentURI) -> FileHandlingCapability
}
public let buildTargetsNotSupported =