Skip to content

Commit 0c37cb3

Browse files
committed
Support workspace/diagnostic/refresh request from TestSourceKitLSPClient
Currently, we return a `methodNotFound` error when we get a diagnostic refresh request from SourceKit-LSP. This doesn’t do any harm but draws the attention when reading test logs, despite being the expected result. Clean up that output by returning a proper response.
1 parent edafb12 commit 0c37cb3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/SKTestSupport/TestSourceKitLSPClient.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,12 @@ package final class TestSourceKitLSPClient: MessageHandler, Sendable {
354354
return (handler, index, handlerAndIsOneShot.isOneShot)
355355
}.first
356356
guard let (requestHandler, index, isOneShot) = requestHandlerIndexAndIsOneShot else {
357+
if Request.self == DiagnosticsRefreshRequest.self {
358+
// Ignore diagnostic refresh requests. This keeps the log a little cleaner than if we return
359+
// methodNotFound.
360+
reply(.success(VoidResponse() as! Request.Response))
361+
return
362+
}
357363
reply(.failure(.methodNotFound(Request.method)))
358364
return
359365
}

0 commit comments

Comments
 (0)