From c04518241d57b2c933854dc687802d050c544b84 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Mon, 7 Apr 2025 18:28:41 -0700 Subject: [PATCH] Fix issue that caused request cancellation after a timeout in tests to not work We were calling `server.handle(notification:)`, which called directly into `SourceKitLSPServer` but request handling is implemented in `QueueBasedMessageHandler.handle(_:)`. Call that to ensure that we actually cancel requests after the test timeout. --- Sources/SKTestSupport/TestSourceKitLSPClient.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SKTestSupport/TestSourceKitLSPClient.swift b/Sources/SKTestSupport/TestSourceKitLSPClient.swift index 516765ff..5a062fe8 100644 --- a/Sources/SKTestSupport/TestSourceKitLSPClient.swift +++ b/Sources/SKTestSupport/TestSourceKitLSPClient.swift @@ -261,7 +261,7 @@ package final class TestSourceKitLSPClient: MessageHandler, Sendable { .failure(ResponseError.unknown("\(R.method) request timed out after \(defaultTimeoutDuration)")) ) } - await server.handle(notification: CancelRequestNotification(id: requestID)) + server.handle(CancelRequestNotification(id: requestID)) } server.handle(request, id: requestID) { result in if replyOutstanding.takeValue() ?? false {