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:
@@ -10,30 +10,22 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import BuildSystemIntegration
|
||||
public import Foundation
|
||||
public import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
package import SKOptions
|
||||
import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
import TSCExtensions
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
|
||||
#if compiler(>=6)
|
||||
package import SKOptions
|
||||
package import SourceKitLSP
|
||||
#else
|
||||
import BuildSystemIntegration
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKOptions
|
||||
import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
import TSCExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#endif
|
||||
|
||||
/// Launches a `SourceKitLSPServer` in-process and allows sending messages to it.
|
||||
@@ -63,6 +55,7 @@ public final class InProcessSourceKitLSPClient: Sendable {
|
||||
package init(
|
||||
toolchainPath: URL?,
|
||||
options: SourceKitLSPOptions = SourceKitLSPOptions(),
|
||||
hooks: Hooks = Hooks(),
|
||||
capabilities: ClientCapabilities = ClientCapabilities(),
|
||||
workspaceFolders: [WorkspaceFolder],
|
||||
messageHandler: any MessageHandler
|
||||
@@ -72,7 +65,7 @@ public final class InProcessSourceKitLSPClient: Sendable {
|
||||
client: serverToClientConnection,
|
||||
toolchainRegistry: ToolchainRegistry(installPath: toolchainPath),
|
||||
options: options,
|
||||
testHooks: TestHooks(),
|
||||
hooks: hooks,
|
||||
onExit: {
|
||||
serverToClientConnection.close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user