[clang-tools-extra] [clangd] Strip invalid fromRanges for outgoing calls (PR #134657)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 10 23:03:36 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- clang-tools-extra/clangd/XRefs.cpp clang-tools-extra/clangd/unittests/CallHierarchyTests.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index 54b99c9a6..df814380f 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -2426,7 +2426,7 @@ outgoingCalls(const CallHierarchyItem &Item, const SymbolIndex *Index) {
       }
       Results.push_back(
           CallHierarchyOutgoingCall{std::move(*CHI), std::move(FromRanges)});
-  }
+    }
   });
   // Sort results by name of the callee.
   llvm::sort(Results, [](const CallHierarchyOutgoingCall &A,
diff --git a/clang-tools-extra/clangd/unittests/CallHierarchyTests.cpp b/clang-tools-extra/clangd/unittests/CallHierarchyTests.cpp
index b9b3325c5..eb852ef5e 100644
--- a/clang-tools-extra/clangd/unittests/CallHierarchyTests.cpp
+++ b/clang-tools-extra/clangd/unittests/CallHierarchyTests.cpp
@@ -398,7 +398,7 @@ TEST(CallHierarchy, MultiFileCpp) {
         OutgoingLevel1,
         // fromRanges are interpreted in the context of Items[0]'s file.
         // If that's the header, we can't get ranges from the implementation
-        // file!      
+        // file!
         ElementsAre(
             AllOf(to(AllOf(withName("caller1"), withDetail("nsa::caller1"))),
                   IsDeclaration ? oFromRanges()

``````````

</details>


https://github.com/llvm/llvm-project/pull/134657


More information about the cfe-commits mailing list