[clang-tools-extra] [clangd] Support go-to-definition on type hints. The protocol part (PR #85497)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 25 03:47:48 PDT 2024
================
@@ -1483,9 +1483,18 @@ llvm::json::Value toJSON(const InlayHintKind &Kind) {
llvm_unreachable("Unknown clang.clangd.InlayHintKind");
}
+namespace {
+
+llvm::json::Array toJSON(const std::vector<InlayHintLabelPart> &Labels) {
+ return llvm::json::Array{
+ llvm::map_range(Labels, [](auto &Label) { return toJSON(Label); })};
+}
+
+} // namespace
+
llvm::json::Value toJSON(const InlayHint &H) {
llvm::json::Object Result{{"position", H.position},
- {"label", H.label},
+ {"label", toJSON(H.label)},
----------------
zyn0217 wrote:
Ah, good catch! I didn't realize there's such an overload previously...
https://github.com/llvm/llvm-project/pull/85497
More information about the cfe-commits
mailing list