mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Implement reloadPackageStatusCallback using BSP messages
This commit is contained in:
@@ -28,24 +28,24 @@ package actor TestBuildSystem: BuiltInBuildSystem {
|
||||
package let indexStorePath: AbsolutePath? = nil
|
||||
package let indexDatabasePath: AbsolutePath? = nil
|
||||
|
||||
private weak var messageHandler: BuiltInBuildSystemMessageHandler?
|
||||
private let connectionToSourceKitLSP: any Connection
|
||||
|
||||
/// Build settings by file.
|
||||
private var buildSettingsByFile: [DocumentURI: SourceKitOptionsResponse] = [:]
|
||||
|
||||
package func setBuildSettings(for uri: DocumentURI, to buildSettings: SourceKitOptionsResponse?) async {
|
||||
package func setBuildSettings(for uri: DocumentURI, to buildSettings: SourceKitOptionsResponse?) {
|
||||
buildSettingsByFile[uri] = buildSettings
|
||||
await self.messageHandler?.sendNotificationToSourceKitLSP(DidChangeBuildTargetNotification(changes: nil))
|
||||
connectionToSourceKitLSP.send(DidChangeBuildTargetNotification(changes: nil))
|
||||
}
|
||||
|
||||
package nonisolated var supportsPreparation: Bool { false }
|
||||
|
||||
package init(
|
||||
projectRoot: AbsolutePath,
|
||||
messageHandler: any BuiltInBuildSystemMessageHandler
|
||||
connectionToSourceKitLSP: any Connection
|
||||
) {
|
||||
self.projectRoot = projectRoot
|
||||
self.messageHandler = messageHandler
|
||||
self.connectionToSourceKitLSP = connectionToSourceKitLSP
|
||||
}
|
||||
|
||||
package func buildTargets(request: BuildTargetsRequest) async throws -> BuildTargetsResponse {
|
||||
|
||||
Reference in New Issue
Block a user