ilya-biryukov added inline comments.
================
Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:644
+ assert(It.second.Edits && "TextEdits hasn't been generated?");
+ if (auto Draft = DraftMgr.getDraft(It.first())) {
+ llvm::StringRef Contents = *Draft;
----------------
This callback is called asynchronously and the version inside `DraftMgr` may be
newer than the one we used to calculate the original offsets inside
replacements at this point.
We should not rely on `DraftMgr`, doing conversions on the source buffers
inside `SourceManager` is probably the most reliable option we have.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66637/new/
https://reviews.llvm.org/D66637
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits