ClangdServer now provides async code completion API.
It is still used synchronously by ClangdLSPServer, more work is needed
to allow processing other requests in parallel while completion (or
any other request) is running.
Details
Diff Detail
- Build Status
Buildable 10885 Build 10885: arc lint + arc unit
Event Timeline
clangd/ClangdServer.cpp | ||
---|---|---|
222 | Sorry, my previously preferred style keeps sneaking in. | |
225 | TLDR; To use in async requests exactly the same preamble that was previously used for sync requests. Those are two different time points. Our callers might change the file when we'll be executing this lambda. I assume that most of time we'll want the preamble that was built at the point where codeComplete is called, not after that. On the other hand, after file was changed, code completion results will probably be irrelevant and will be discarded by clients anyway, so that might not matter. I've opted for not changing the behavior and using the same preamble that was previously used by the synchronous version. (Unless Preamble was null in the sync case, where we would only improve performance). |
clangd/ClangdServer.h | ||
---|---|---|
236–237 | Split into two sentences on , instead of replacing it with ;. Feels even better. |
Extra space before asynchronously.
Replace first ',' with ';'
... wait for the results of the async request...