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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 4 05:39:13 PST 2020


sammccall created this revision.
sammccall added a reviewer: kadircet.
Herald added subscribers: cfe-commits, usaxena95, jfb, arphaman, jkorous, MaskRay, javed.absar, ilya-biryukov.
Herald added a project: clang.

Otherwise they can force us to build lots of snapshots that we don't need.
Particularly, try to do this for operations that are frequently
generated by editors without explicit user interaction, and where
editing the file makes the result less useful. (Code action
enumeration is a good example).

https://github.com/clangd/clangd/issues/298

This doesn't return the "right" LSP error code (ContentModified) to the client,
we need to teach the cancellation API to distinguish between different causes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75602

Files:
  clang-tools-extra/clangd/Cancellation.cpp
  clang-tools-extra/clangd/ClangdServer.cpp
  clang-tools-extra/clangd/JSONTransport.cpp
  clang-tools-extra/clangd/TUScheduler.cpp
  clang-tools-extra/clangd/TUScheduler.h
  clang-tools-extra/clangd/unittests/CancellationTests.cpp
  clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75602.248150.patch
Type: text/x-patch
Size: 15589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200304/aa10c5bb/attachment-0001.bin>


More information about the cfe-commits mailing list