[PATCH] D44408: Move DraftMgr from ClangdServer to ClangdLSPServer
Simon Marchi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 12 18:13:56 PDT 2018
simark created this revision.
Herald added subscribers: cfe-commits, ioeric, jkorous-apple, ilya-biryukov, mgorny, klimek.
This patch moves the draft manager closer to the edge of Clangd, from
ClangdServer to ClangdLSPServer. This will make it easier to implement
incremental document sync, by making ClangdServer only deal with
As a result, DraftStore doesn't have to deal with versioning, and thus
its API can be simplified. It is replaced by a StringMap in
ClangdServer holding a current version number for each file.
The current implementation of reparseOpenedFiles is racy. It calls
getActiveDrafts and calls forceReparse for each of them. forceReparse
gets the draft fromt he DraftStore. In theory, it's possible for a file
to have been closed in the mean time. I replaced getActiveDrafts by
forEachActiveDraft. It has the advantage that the DraftStore lock is
held while we iterate on the drafts.
Signed-off-by: Simon Marchi <simon.marchi at ericsson.com>
rCTE Clang Tools Extra
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 37798 bytes
Desc: not available
More information about the cfe-commits