[PATCH] D75602: [clangd] Cancel certain operations if the file changes before we start.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 4 07:52:13 PST 2020


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

thanks, LGTM



================
Comment at: clang-tools-extra/clangd/Cancellation.cpp:39
+      return true;
   return false; // Not in scope of a task.
 }
----------------
comment seems to be out-of-date.

`Either not cancelled or not in a cancellable task` ?


================
Comment at: clang-tools-extra/clangd/JSONTransport.cpp:23
+  // FIXME: encode cancellation errors using RequestCancelled or ContentModified
+  // as approprate.
   if (llvm::Error Unhandled = llvm::handleErrors(
----------------
s/approprate/appropriate/


================
Comment at: clang-tools-extra/clangd/TUScheduler.cpp:673
+    // Cancel any requests invalidated by this request.
+    if (UpdateType)
+      for (auto &R : llvm::reverse(Requests)) {
----------------
braces


================
Comment at: clang-tools-extra/clangd/TUScheduler.cpp:682
+    // Allow this request to be cancelled if invalidated.
+    Context Ctx = Context::current().derive(kFileBeingProcessed, FileName);
+    Canceler Invalidate = nullptr;
----------------
this one is already being put into the context before pushing into requests.


================
Comment at: clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp:364
+        ++Actions;
+        EXPECT_FALSE(!!AST);
+        llvm::Error E = AST.takeError();
----------------
nit: `bool(AST)` ? same in other places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75602





More information about the cfe-commits mailing list