Interface IFormatterParticipant
- All Known Implementing Classes:
ContentModelFormatterParticipant,XSIFormatterParticipant
public interface IFormatterParticipant
XML formatter participant.
- Author:
- Angelo ZERR
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanformatAttributeValue(String name, String valueWithoutQuote, Character quote, DOMAttr attr, XMLBuilder xml) Format the given attribute value.default booleanformatAttributeValue(DOMAttr attr, XMLFormatterDocument formatterDocument, XMLFormattingConstraints parentConstraints, XMLFormattingOptions formattingOptions, List<org.eclipse.lsp4j.TextEdit> edits) Format the given attribute value.default FormatElementCategorygetFormatElementCategory(DOMElement element, XMLFormattingConstraints parentConstraints, Map<String, Collection<CMDocument>> formattingContext, SharedSettings sharedSettings) Returns the format element category for the given DOM element and null otherwise.default booleanshouldCollapseEmptyElement(DOMElement element, SharedSettings sharedSettings) Returns true if the given element can be collapsed according to grammar constraints.
-
Method Details
-
formatAttributeValue
default boolean formatAttributeValue(String name, String valueWithoutQuote, Character quote, DOMAttr attr, XMLBuilder xml) Format the given attribute value.The formatter must take care of to generate attribute value with quote.
- Parameters:
name- the attribute name.valueWithoutQuote- the attribute value without quote.quote- the quote and null otherwise. null quote means that the formatter must not generate a quote in the xml builder.attr- the DOM attribute and null otherwise.xml- the XML builder.- Returns:
- true if the given attribute can be formatted and false otherwise.
-
formatAttributeValue
default boolean formatAttributeValue(DOMAttr attr, XMLFormatterDocument formatterDocument, XMLFormattingConstraints parentConstraints, XMLFormattingOptions formattingOptions, List<org.eclipse.lsp4j.TextEdit> edits) Format the given attribute value.- Parameters:
formatterDocument- the formatter documentindentLevel- the current indent level of the attributeformattingOptions- the formatting options that contain the settingsattr- the attribute nodeedits- the text edit list- Returns:
- true if the given attribute can be formatted and false otherwise.
-