[PATCH] D144453: [clangd] Fix a bug in TweakTest::decorate()

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 14 00:02:53 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe9a88b6178d3: [clangd] Fix a bug in TweakTest::decorate() (authored by nridge).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144453

Files:
  clang-tools-extra/clangd/unittests/tweaks/TweakTesting.cpp


Index: clang-tools-extra/clangd/unittests/tweaks/TweakTesting.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/tweaks/TweakTesting.cpp
+++ clang-tools-extra/clangd/unittests/tweaks/TweakTesting.cpp
@@ -157,7 +157,8 @@
 std::string TweakTest::decorate(llvm::StringRef Code,
                                 llvm::Annotations::Range Range) {
   return (Code.substr(0, Range.Begin) + "[[" +
-          Code.substr(Range.Begin, Range.End) + "]]" + Code.substr(Range.End))
+          Code.substr(Range.Begin, Range.End - Range.Begin) + "]]" +
+          Code.substr(Range.End))
       .str();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144453.504960.patch
Type: text/x-patch
Size: 655 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230314/c81ad6a6/attachment.bin>


More information about the cfe-commits mailing list