@@ -1689,6 +1689,48 @@ enum class InlayHintKind {
16891689};
16901690llvm::json::Value toJSON (const InlayHintKind &);
16911691
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+
16921734// / Inlay hint information.
16931735struct InlayHint {
16941736 // / The position of this hint.
@@ -1698,7 +1740,7 @@ struct InlayHint {
16981740 // / InlayHintLabelPart label parts.
16991741 // /
17001742 // / *Note* that neither the string nor the label part can be empty.
1701- std::string label;
1743+ std::vector<InlayHintLabelPart> label;
17021744
17031745 // / The kind of this hint. Can be omitted in which case the client should fall
17041746 // / back to a reasonable default.
@@ -1724,6 +1766,9 @@ struct InlayHint {
17241766 // / The range allows clients more flexibility of when/how to display the hint.
17251767 // / This is an (unserialized) clangd extension.
17261768 Range range;
1769+
1770+ // / Join the label[].value together.
1771+ std::string joinLabels () const ;
17271772};
17281773llvm::json::Value toJSON (const InlayHint &);
17291774bool operator ==(const InlayHint &, const InlayHint &);
0 commit comments