sammccall added a comment.
Let's make the minimal change here and land this.
================
Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:1126
+ std::set<std::string> ModifiedFiles;
+ auto Sub =
+ CDB->watch([&ModifiedFiles](const std::vector<std::string> Changes) {
----------------
dgoldman wrote:
> sammccall wrote:
> > this is a clever technique. (Why not just use compilationDatabaseChanges
> > directly? I suppose because then you have to deal more with path
> > canonicalization?)
> >
> > it risks having the CDB change concurrently and reloading those files too,
> > though.
> > I guess there's not much harm in it. But in that case, why aren't we just
> > permanently subscribing to CDB changes and re-parsing affected files? Lack
> > of a thread to do it on?
> Yeah I think `compilationDatabaseChanges` would be equivalent to what is here
> now, I can just swap to that.
>
> For the perma subscribe I wasn't sure of the threading. If addDocument is
> thread safe I think we're okay to just call `Server->AddDocument` from
> whatever thread without holding a mutex?
ClangdServer isn't threadsafe, that's a good point.
> Yeah I think compilationDatabaseChanges would be equivalent to what is here
> now, I can just swap to that.
This is the minimal change, let's do that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72647/new/
https://reviews.llvm.org/D72647
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits