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.
This commit is contained in:
Alex Hoppen
2025-01-02 13:23:18 +01:00
parent e93b7ed6bf
commit e59df13bb0

View File

@@ -654,7 +654,9 @@ extension SourceKitLSPServer: QueueBasedMessageHandler {
) async {
defer {
if let request = params as? any TextDocumentRequest {
self.inProgressTextDocumentRequests[request.textDocument.uri, default: []].removeAll { $0.id == id }
textDocumentTrackingQueue.async(priority: .background) {
self.inProgressTextDocumentRequests[request.textDocument.uri, default: []].removeAll { $0.id == id }
}
}
}