sammccall added inline comments.
================ Comment at: clang-tools-extra/clangd/SourceCode.cpp:601 + llvm::inconvertibleErrorCode(), + "File contents differ on disk for %s, please save", FilePath.data()); + } ---------------- kadircet wrote: > sammccall wrote: > > you seem to be checking this both here and in clangdlspserver. Why? > the contents in here are coming from disk, whereas the one in clangdlspserver > is coming from drafts. I suppose it would make more sense to merge the two in > clangdlspserver, use draft manager as content source backed by disk in case > user hasn't opened that file. OK, so you're checking here whether the contents-on-disk have changed between clang reading the file as part of parse, and the tweak completing? I don't think this is worth doing. Sure, there's potentially a race condition, but it's relatively small (bounded on the order of a few seconds, vs unbounded for unsaved drafts) and we can't eliminate it entirely (file on disk can change between when we create edits and when they're applied). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66637/new/ https://reviews.llvm.org/D66637 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits