[PATCH] D44408: Move DraftMgr from ClangdServer to ClangdLSPServer

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 14 05:10:32 PDT 2018


ilya-biryukov added a reviewer: ilya-biryukov.
ilya-biryukov requested changes to this revision.
ilya-biryukov added a comment.
This revision now requires changes to proceed.

We shouldn't add `Contents` parameter to every method, it would defeat the purpose of caching ASTs and won't allow to properly manage lifetimes of the indexes.

The most tricky part is getting rid of `DraftMgr` in `forceReparse`. Here's a change that removes usages of it there: https://reviews.llvm.org/D44462`, it should be much easier to make it work when it lands.
Any other reason why we need to add them?



================
Comment at: clangd/ClangdLSPServer.h:87
+  /// conversions in outside code, maybe there's a way to get rid of it.
+  llvm::Optional<std::string> getDocument(PathRef File);
+
----------------
We can remove this function now, it is equivalent to a one-liner `DraftMgr.getDraft(File).Draft`


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44408





More information about the cfe-commits mailing list