[PATCH] D97738: [clangd] Move DraftStore from ClangdLSPServer into ClangdServer.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 1 15:19:02 PST 2021


sammccall created this revision.
sammccall added reviewers: njames93, kadircet.
Herald added subscribers: usaxena95, arphaman.
sammccall requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang.

ClangdServer already gets notified of every change, so it makes sense for it to
be the source of truth.
This is a step towards having ClangdServer expose a FS that includes dirty
buffers: D94554 <https://reviews.llvm.org/D94554>

Related changes:

- version is now optional for ClangdServer, to preserve our existing fuzziness in this area (missing version ==> autoincrement)
- ClangdServer::format{File,Range} are now more regular ClangdServer functions that don't need the code passed in. While here, combine into one function.
- incremental content update logic is moved from DraftStore to ClangdLSPServer, with most of the implementation in SourceCode.cpp. DraftStore is now fairly trivial, and will probably ultimately be *replaced* by the dirty FS stuff.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97738

Files:
  clang-tools-extra/clangd/ClangdLSPServer.cpp
  clang-tools-extra/clangd/ClangdLSPServer.h
  clang-tools-extra/clangd/ClangdServer.cpp
  clang-tools-extra/clangd/ClangdServer.h
  clang-tools-extra/clangd/DraftStore.cpp
  clang-tools-extra/clangd/DraftStore.h
  clang-tools-extra/clangd/SourceCode.cpp
  clang-tools-extra/clangd/SourceCode.h
  clang-tools-extra/clangd/test/crash-non-added-files.test
  clang-tools-extra/clangd/unittests/ClangdTests.cpp
  clang-tools-extra/clangd/unittests/DraftStoreTests.cpp
  clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
  clang-tools-extra/clangd/unittests/SyncAPI.cpp
  clang-tools-extra/clangd/unittests/SyncAPI.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97738.327303.patch
Type: text/x-patch
Size: 54358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210301/07637441/attachment-0001.bin>


More information about the cfe-commits mailing list