[PATCH] D77947: [clangd] Send the correct error code when cancelling requests.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 12 02:06:58 PDT 2020


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

Thanks for remembering this :D LGTM!



================
Comment at: clang-tools-extra/clangd/JSONTransport.cpp:28
+          [&](const CancelledError &C) -> llvm::Error {
+            switch (C.Reason) {
+              case static_cast<int>(ErrorCode::ContentModified):
----------------
Maybe `static_cast<ErrorCode>(C.Reason)` instead of casting cases.

I know the reason is not necessarily LSP specific, but we seem to be defaulting to `ErrorCode::RequestCancelled` anyways.


================
Comment at: clang-tools-extra/clangd/JSONTransport.cpp:29
+            switch (C.Reason) {
+              case static_cast<int>(ErrorCode::ContentModified):
+                Code = ErrorCode::ContentModified;
----------------
please fix


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77947/new/

https://reviews.llvm.org/D77947





More information about the cfe-commits mailing list