[PATCH] D54829: [clangd] Cleanup: make diagnostics callbacks from TUScheduler non-racy

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 22 02:32:52 PST 2018


ilya-biryukov created this revision.
ilya-biryukov added a reviewer: sammccall.
Herald added subscribers: kadircet, jfb, arphaman, jkorous, MaskRay, ioeric, javed.absar.

Previously, removeDoc followed by an addDoc to TUScheduler resulted in
racy diagnostic responses, i.e. the old dianostics could be delivered
to the client after the new ones by TUScheduler.

To workaround this, we tracked a version number in ClangdServer and
discarded stale diagnostics. After this commit, the TUScheduler will
stop delivering diagnostics for removed files and the workaround in
ClangdServer is not required anymore.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54829

Files:
  clangd/ClangdServer.cpp
  clangd/ClangdServer.h
  clangd/TUScheduler.cpp
  unittests/clangd/ClangdTests.cpp
  unittests/clangd/TUSchedulerTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54829.175026.patch
Type: text/x-patch
Size: 5945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181122/d7d9f50e/attachment.bin>


More information about the cfe-commits mailing list