[PATCH] D50502: [clangd] Initial cancellation mechanism for LSP requests.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 17 08:28:00 PDT 2018


kadircet marked an inline comment as done.
kadircet added inline comments.


================
Comment at: clangd/ClangdLSPServer.cpp:621
+  std::lock_guard<std::mutex> Lock(TaskHandlesMutex);
+  const auto &it = TaskHandles.find(Params.ID);
+  if (it != TaskHandles.end()) {
----------------
ilya-biryukov wrote:
> Wouldn't it work incorrectly for string IDs?
> When normalizing `json::Value` from `getRequestID`, we simply print out json. For strings, this should result in quoted output, e.g. `"req"`. However, when parsing `CancelParams`, we parse this json. So we'll end up inserting with a key `"req"` and erasing with a key 'req' (without the quotes).
You are right, that's exactly the case, thanks!


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50502





More information about the cfe-commits mailing list