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:
Alex Hoppen
2024-08-23 16:59:07 -07:00
parent b490a6fef1
commit 6a9dcd2349
9 changed files with 218 additions and 168 deletions

View File

@@ -15,6 +15,7 @@ import Foundation
import LanguageServerProtocol
import LanguageServerProtocolJSONRPC
import SKLogging
import SKOptions
import SKSupport
import SwiftExtensions
import ToolchainRegistry
@@ -259,6 +260,13 @@ private func readReponseDataKey(data: LSPAny?, key: String) -> String? {
}
extension BuildServerBuildSystem: BuiltInBuildSystem {
static package func projectRoot(for workspaceFolder: AbsolutePath, options: SourceKitLSPOptions) -> AbsolutePath? {
guard localFileSystem.isFile(workspaceFolder.appending(component: "buildServer.json")) else {
return nil
}
return workspaceFolder
}
package nonisolated var supportsPreparation: Bool { false }
/// The build settings for the given file.