[PATCH] D102761: [clangd] New ParsingCallback for semantics changes

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 25 02:39:18 PDT 2021


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

It seems like a lit test for this would be terrible. A ClangdServer one should be possible, but I can't quite wrap my head around how to write it.

(Delivering the PreambleData as a param would make the test easier, you could assert that the preamble version was > any previously notified preamble & also > any preamble previously obtained via runWithPreamble.)



================
Comment at: clang-tools-extra/clangd/TUScheduler.h:175
+  /// on the file are guranteed to see new semantics after the callback.
+  virtual void onSemanticsMaybeChanged(PathRef File) {}
 };
----------------
This seems a little vague/abstract for TUScheduler.
The "caller" (i.e. ClangdServer impl) needs to know about preambles etc, c.f. onPreambleAST in this same interface.

I'd suggest `onPreambleActive` or `onPreamblePublished` or something like that.
(Passing the PreambleData struct as a param would also hint nicely at the distinction vs onPreambleAST but is maybe too cute if we're not actually going to use it...)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102761/new/

https://reviews.llvm.org/D102761



More information about the cfe-commits mailing list