mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Allow injection of build systems into SourceKitLSP
This allows us to clean up the creation of `TestBuildSystem` a little bit because the tests can create `TestBuildSystem` instead of retrieving it from the `BuildSystemManager`. rdar://142906050
This commit is contained in:
@@ -36,8 +36,13 @@ import struct TSCBasic.AbsolutePath
|
||||
/// Returns `nil` if no build system can handle this workspace folder.
|
||||
package func determineBuildSystem(
|
||||
forWorkspaceFolder workspaceFolder: DocumentURI,
|
||||
options: SourceKitLSPOptions
|
||||
options: SourceKitLSPOptions,
|
||||
hooks: BuildSystemHooks
|
||||
) -> BuildSystemSpec? {
|
||||
if let workspaceURL = workspaceFolder.fileURL, let buildSystemInjector = hooks.buildSystemInjector {
|
||||
return BuildSystemSpec(kind: .injected(buildSystemInjector), projectRoot: workspaceURL)
|
||||
}
|
||||
|
||||
var buildSystemPreference: [WorkspaceType] = [
|
||||
.buildServer, .swiftPM, .compilationDatabase,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user