[clang-tools-extra] [clangd] Support go-to-definition on type hints. The protocol part (PR #85497)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 15 21:49:07 PDT 2024


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 fd3eaf76ba3392a4406247d996e757ef49f7a8b2 6d61aa1e43bb522412904bdd77c7f1cfc4b42889 -- clang-tools-extra/clangd/ClangdLSPServer.cpp clang-tools-extra/clangd/InlayHints.cpp clang-tools-extra/clangd/Protocol.cpp clang-tools-extra/clangd/Protocol.h clang-tools-extra/clangd/tool/Check.cpp clang-tools-extra/clangd/unittests/InlayHintTests.cpp
``````````

</details>

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

``````````diff
diff --git a/clang-tools-extra/clangd/InlayHints.cpp b/clang-tools-extra/clangd/InlayHints.cpp
index 5a9ec9ab67..cd4f1931b3 100644
--- a/clang-tools-extra/clangd/InlayHints.cpp
+++ b/clang-tools-extra/clangd/InlayHints.cpp
@@ -979,10 +979,7 @@ private:
     bool PadRight = Suffix.consume_back(" ");
     Results.push_back(InlayHint{LSPPos,
                                 /*label=*/{(Prefix + Label + Suffix).str()},
-                                Kind,
-                                PadLeft,
-                                PadRight,
-                                LSPRange});
+                                Kind, PadLeft, PadRight, LSPRange});
   }
 
   // Get the range of the main file that *exactly* corresponds to R.
diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h
index 1f9c562552..6fd6b9955b 100644
--- a/clang-tools-extra/clangd/Protocol.h
+++ b/clang-tools-extra/clangd/Protocol.h
@@ -1701,21 +1701,21 @@ struct InlayHintLabelPart {
   std::string value;
 
   /// The tooltip text when you hover over this label part. Depending on
-	/// the client capability `inlayHint.resolveSupport`, clients might resolve
-	/// this property late using the resolve request.
+  /// the client capability `inlayHint.resolveSupport`, clients might resolve
+  /// this property late using the resolve request.
   std::optional<MarkupContent> tooltip;
 
-	/// An optional source code location that represents this
-	/// label part.
-	///
-	/// The editor will use this location for the hover and for code navigation
-	/// features: This part will become a clickable link that resolves to the
-	/// definition of the symbol at the given location (not necessarily the
-	/// location itself), it shows the hover that shows at the given location,
-	/// and it shows a context menu with further code navigation commands.
-	///
-	/// Depending on the client capability `inlayHint.resolveSupport` clients
-	/// might resolve this property late using the resolve request.
+  /// An optional source code location that represents this
+  /// label part.
+  ///
+  /// The editor will use this location for the hover and for code navigation
+  /// features: This part will become a clickable link that resolves to the
+  /// definition of the symbol at the given location (not necessarily the
+  /// location itself), it shows the hover that shows at the given location,
+  /// and it shows a context menu with further code navigation commands.
+  ///
+  /// Depending on the client capability `inlayHint.resolveSupport` clients
+  /// might resolve this property late using the resolve request.
   std::optional<Location> location;
 
   /// The command field is not used for now, hence omitted.

``````````

</details>


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


More information about the cfe-commits mailing list