ChuanqiXu added a comment.

@sammccall @nridge while I am looking for the initial support for modules in 
clangd, I failed to find the mechanism to update files after I update a header 
file.

e.g., when I am opening the following file:

  // a.cc
  #include "a.h"
  ...

and there is a concurrent update to `a.h`. How can the ASTWorker of `a.cc` know 
such changes so that it can update the corresponding Preamble of `a.cc`?

In the comments of `ClangdServer::reparseOpenFilesIfNeeded()`, I see:

> /// Requests a reparse of currently opened files using their latest source.
> /// This will typically only rebuild if something other than the source has
> /// changed (e.g. the CDB yields different flags, or **files included in the
> /// preamble have been modified**).

So I thought this is what I want. However, I can't search the caller of 
`reparseOpenFilesIfNeeded` which semantics matches the behavior. The two 
callers of  `reparseOpenFilesIfNeeded` I found are 
`ClangdLSPServer::applyConfiguration()` and 
`ClangdLSPServer::onDocumentDidSave()` and neither of them matches description 
`files included in the  preamble have been modified`.

So I want to ask what's the behavior when I update a header and where is the 
corresponding code. Thanks.


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

https://reviews.llvm.org/D153114

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to