Skip to content

Commit c68a989

Browse files
committed
Log sourcekitd requests inside withCancellableCheckedThrowingContinuation
Otherwise, we would log sending the sourcekitd request even if the task was already cancelled and we thus took an early exit in `withCancellableCheckedThrowingContinuation`.
1 parent 34f9772 commit c68a989

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/SourceKitD/SourceKitD.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ extension SourceKitD {
139139
timeout: Duration,
140140
fileContents: String?
141141
) async throws -> SKDResponseDictionary {
142-
log(request: request)
143-
144142
let sourcekitdResponse = try await withTimeout(timeout) {
145143
return try await withCancellableCheckedThrowingContinuation { (continuation) -> SourceKitDRequestHandle? in
144+
self.log(request: request)
146145
var handle: sourcekitd_api_request_handle_t? = nil
147146
self.api.send_request(request.dict, &handle) { response in
148147
continuation.resume(returning: SKDResponse(response!, sourcekitd: self))

0 commit comments

Comments
 (0)