[PATCH] D43518: [clangd] Allow embedders some control over when diagnostics are generated.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 10:56:41 PST 2018


sammccall created this revision.
sammccall added a reviewer: ilya-biryukov.
Herald added subscribers: cfe-commits, ioeric, jkorous-apple, klimek.

Through the C++ API, we support for a given snapshot version:

- Yes: make sure we generate diagnostics for exactly this version
- Auto: generate eventually-consistent diagnostics for at least this version
- No: don't generate diagnostics for this version

Eventually auto should be debounced for better UX.

Through LSP, we force diagnostics for initial load (bypassing future debouncing)
and all updates follow the "auto" policy.

This is complicated to implement under the CancellationFlag design, so
rewrote that part to just inspect the queue instead.

It turns out we never pass None to the diagnostics callback, so remove Optional
from the signature. The questionable behavior of not invoking the callback at
all if CppFile::rebuild fails is not changed.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43518

Files:
  clangd/ClangdLSPServer.cpp
  clangd/ClangdServer.cpp
  clangd/ClangdServer.h
  clangd/TUScheduler.cpp
  clangd/TUScheduler.h
  clangd/Threading.cpp
  clangd/Threading.h
  unittests/clangd/TUSchedulerTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43518.135104.patch
Type: text/x-patch
Size: 17471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180220/b12be5e3/attachment.bin>


More information about the cfe-commits mailing list