Skip to content

Commit a1ca0d3

Browse files
authored
Merge pull request #2050 from ahoppen/task-cancellation-before-sourcekitd
Log sourcekitd requests inside `withCancellableCheckedThrowingContinuation`
2 parents e47a2a3 + c68a989 commit a1ca0d3

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)