[PATCH] D44462: [clangd] Don't use DraftMgr in implementation of forceReparse.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 14 07:24:33 PDT 2018

sammccall added a comment.

This patch is the right direction, but if you're up for it we can simplify interfaces further I think.

Comment at: clangd/TUScheduler.h:62
+  /// Returns a list of currently tracked files. File starts being trakced on
+  /// first update() call to it and stops being tracked on remove() call.
simark wrote:
> "trakced"

Comment at: clangd/TUScheduler.h:69
+  /// FIXME: remove the callback from this function
+  void updateCompileCommand(PathRef File, tooling::CompileCommand NewCommand,
+                            IntrusiveRefCntPtr<vfs::FileSystem> FS,
(summarizing offline discussion)

this is so close to `update`, it'd be nice if we could just call `update` instead.

For that we need the contents, so forceReparse needs contents, so... can forceReparse just be addDocument(skipCache=true) or something?

Requiring content to be passed doesn't seem like a big burden in practice, and makes it clear that clangdserver is never responsible for maintaining copies of the content on the callers behalf (and clangdlspserver is).

reparseOpenFiles needs to move to clangdlspserver, but this seems consistent with the design. (so I think we can drop getTrackedFiles?)

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list