Skip to content

Commit e59df13

Browse files
committed
Clear inProgressTextDocumentRequests on textDocumentTrackingQueue
`inProgressTextDocumentRequests` is supposed to only be accessed on `textDocumentTrackingQueue` but we were accessing it outside of that queue. Because of this, we might try to remove requests from `inProgressTextDocumentRequests` before adding them, which would cause them to stay in the list indefinitely.
1 parent e93b7ed commit e59df13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/SourceKitLSP/SourceKitLSPServer.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,9 @@ extension SourceKitLSPServer: QueueBasedMessageHandler {
654654
) async {
655655
defer {
656656
if let request = params as? any TextDocumentRequest {
657-
self.inProgressTextDocumentRequests[request.textDocument.uri, default: []].removeAll { $0.id == id }
657+
textDocumentTrackingQueue.async(priority: .background) {
658+
self.inProgressTextDocumentRequests[request.textDocument.uri, default: []].removeAll { $0.id == id }
659+
}
658660
}
659661
}
660662

0 commit comments

Comments
 (0)