Class ContentModelInlayHintParticipant
java.lang.Object
org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelInlayHintParticipant
- All Implemented Interfaces:
IInlayHintParticipant
Inlay hint participant that shows grammar-defined information for XML
elements and attributes:
- Default attribute values: shows default/fixed attribute values from the bound grammar (XSD, DTD) when an element does not explicitly specify them.
- Attribute types: shows the type of each attribute (e.g.,
: xs:integer) after the attribute name. - Element types: shows the type of each element (e.g.,
: inputType) after the element tag name.
For example, given the following XSD:
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="age" type="xs:integer" />
</xs:sequence>
<xs:attribute name="id" type="xs:int" />
<xs:attribute name="lang" type="xs:string" default="en" />
</xs:complexType>
</xs:element>
When the XML document contains:
<person id="42"> <age>30</age> </person>
The following inlay hints are shown:
idattribute:: xs:int(attribute type)lang="en"(default value)ageelement:: xs:integer(element type)
Types equal to xs:string are filtered out as they are too common
to be informative.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoInlayHint(IInlayHintRequest request, List<org.eclipse.lsp4j.InlayHint> inlayHints, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
-
Constructor Details
-
ContentModelInlayHintParticipant
-
-
Method Details
-
doInlayHint
public void doInlayHint(IInlayHintRequest request, List<org.eclipse.lsp4j.InlayHint> inlayHints, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) - Specified by:
doInlayHintin interfaceIInlayHintParticipant
-