@@ -1689,6 +1689,48 @@ enum class InlayHintKind {
1689
1689
};
1690
1690
llvm::json::Value toJSON (const InlayHintKind &);
1691
1691
1692
+ // / An inlay hint label part allows for interactive and composite labels
1693
+ // / of inlay hints.
1694
+ struct InlayHintLabelPart {
1695
+
1696
+ InlayHintLabelPart () = default ;
1697
+
1698
+ InlayHintLabelPart (std::string value,
1699
+ std::optional<Location> location = std::nullopt)
1700
+ : value(std::move(value)), location(std::move(location)) {}
1701
+
1702
+ // / The value of this label part.
1703
+ std::string value;
1704
+
1705
+ // / The tooltip text when you hover over this label part. Depending on
1706
+ // / the client capability `inlayHint.resolveSupport`, clients might resolve
1707
+ // / this property late using the resolve request.
1708
+ std::optional<MarkupContent> tooltip;
1709
+
1710
+ // / An optional source code location that represents this
1711
+ // / label part.
1712
+ // /
1713
+ // / The editor will use this location for the hover and for code navigation
1714
+ // / features: This part will become a clickable link that resolves to the
1715
+ // / definition of the symbol at the given location (not necessarily the
1716
+ // / location itself), it shows the hover that shows at the given location,
1717
+ // / and it shows a context menu with further code navigation commands.
1718
+ // /
1719
+ // / Depending on the client capability `inlayHint.resolveSupport` clients
1720
+ // / might resolve this property late using the resolve request.
1721
+ std::optional<Location> location;
1722
+
1723
+ // / An optional command for this label part.
1724
+ // /
1725
+ // / Depending on the client capability `inlayHint.resolveSupport` clients
1726
+ // / might resolve this property late using the resolve request.
1727
+ std::optional<Command> command;
1728
+ };
1729
+ llvm::json::Value toJSON (const InlayHintLabelPart &);
1730
+ bool operator ==(const InlayHintLabelPart &, const InlayHintLabelPart &);
1731
+ bool operator <(const InlayHintLabelPart &, const InlayHintLabelPart &);
1732
+ llvm::raw_ostream &operator <<(llvm::raw_ostream &, const InlayHintLabelPart &);
1733
+
1692
1734
// / Inlay hint information.
1693
1735
struct InlayHint {
1694
1736
// / The position of this hint.
@@ -1698,7 +1740,7 @@ struct InlayHint {
1698
1740
// / InlayHintLabelPart label parts.
1699
1741
// /
1700
1742
// / *Note* that neither the string nor the label part can be empty.
1701
- std::string label;
1743
+ std::vector<InlayHintLabelPart> label;
1702
1744
1703
1745
// / The kind of this hint. Can be omitted in which case the client should fall
1704
1746
// / back to a reasonable default.
@@ -1724,6 +1766,9 @@ struct InlayHint {
1724
1766
// / The range allows clients more flexibility of when/how to display the hint.
1725
1767
// / This is an (unserialized) clangd extension.
1726
1768
Range range;
1769
+
1770
+ // / Join the label[].value together.
1771
+ std::string joinLabels () const ;
1727
1772
};
1728
1773
llvm::json::Value toJSON (const InlayHint &);
1729
1774
bool operator ==(const InlayHint &, const InlayHint &);
0 commit comments