[PATCH] D97123: [clangd] Support FixIts that use InsertFromRange instead of inserting raw text

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 08:52:00 PST 2021


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/SourceCode.cpp:552
   Result.newText = FixIt.CodeToInsert;
+  if (Result.newText.empty() && FixIt.InsertFromRange.isValid()) {
+    bool Invalid = false;
----------------
oh btw, i think the condition should only check for validness of the `InsertFromRange`, and then we should assert for the emptyness of `CodeToInsert`. (same for the piece in Diagnostics.cpp)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97123



More information about the cfe-commits mailing list