Class ContentModelInlayHintParticipant

java.lang.Object
org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelInlayHintParticipant
All Implemented Interfaces:
IInlayHintParticipant

public class ContentModelInlayHintParticipant extends Object implements 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:

  • id attribute: : xs:int (attribute type)
  • lang="en" (default value)
  • age element: : xs:integer (element type)

Types equal to xs:string are filtered out as they are too common to be informative.

  • Constructor Details

    • ContentModelInlayHintParticipant

      public ContentModelInlayHintParticipant(ContentModelManager contentModelManager)
  • Method Details