[PATCH] D153114: [clangd] [C++20] [Modules] Support C++20 modules for clangd
Nathan Ridge via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 31 01:13:32 PDT 2023
nridge added a comment.
In D153114#4630318 <https://reviews.llvm.org/D153114#4630318>, @ChuanqiXu wrote:
> 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.
I'm afraid `onDocumentDidSave()` is all we have for now. It detects changes to the header when editing the header in the client (when the header is saved). I don't believe we have a mechanism for detecting changes to the header made in other ways.
If/when we want to add such a mechanism, I think the way to do it is using didChangeWatchedFiles <https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeWatchedFiles> (there is some discussion there about why LSP recommends servers delegate file-watching to the client rather than implementing file-watching in the server).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153114/new/
https://reviews.llvm.org/D153114
More information about the cfe-commits
mailing list