mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Split determining which build system to use for a workspace and the workspace creation
This allows us to create the build system from a `BuiltInBuildSystemAdapter` when it receives an `InitializeRequest`, which will be done in a follow-up commit.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
import BuildServerProtocol
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SKOptions
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
@@ -67,6 +68,13 @@ package struct PrepareNotSupportedError: Error, CustomStringConvertible {
|
||||
/// For example, a SwiftPMWorkspace provides compiler arguments for the files
|
||||
/// contained in a SwiftPM package root directory.
|
||||
package protocol BuiltInBuildSystem: AnyObject, Sendable {
|
||||
/// When opening an LSP workspace at `workspaceFolder`, determine the directory in which a project of this build system
|
||||
/// starts. For example, a user might open the `Sources` folder of a SwiftPM project, then the project root is the
|
||||
/// directory containing `Package.swift`.
|
||||
///
|
||||
/// Returns `nil` if the build system can't handle the given workspace folder
|
||||
static func projectRoot(for workspaceFolder: AbsolutePath, options: SourceKitLSPOptions) -> AbsolutePath?
|
||||
|
||||
/// The root of the project that this build system manages. For example, for SwiftPM packages, this is the folder
|
||||
/// containing Package.swift. For compilation databases it is the root folder based on which the compilation database
|
||||
/// was found.
|
||||
|
||||
Reference in New Issue
Block a user