Files
sourcekit-lsp/Sources/LanguageServerProtocolJSONRPC
Alex Hoppen 7c0a910358 Handle messages on a serial queue in Connection
When we switch `SourceKitServer`, `SwiftLanguageServer` etc. to be actors, we can’t rely on them to provide ordering guarantees anymore because Swift concurrency doesn’t provide any ordering guarantees.

What we should thus do, is to handle all messages on a serial queue on the `Connection` level. This queue will be blocked from handling any new messages until a message has been sufficiently handled to avoid out-of-order handling of messages. For sourcekitd, this means that
a request has been sent to sourcekitd and for clangd, this means that we have forwarded the request to clangd.

Note that this serial queue is not the main thread, so we will continue accepting data over stdin, just the handling of those messages is blocked.
2023-09-27 09:47:51 -07:00
..