S
- the source element Java type.G
- the generator Java type.public abstract class AbstractElementCompletionItem<S,G>
extends org.eclipse.lsp4j.CompletionItem
CompletionItem
to report an XML element completion
item. This class returns a TextEdit
which contains the full element
content (ex : Modifier and Type | Field and Description |
---|---|
static String |
UPDATE_END_TAG_NAME_FIELD |
Constructor and Description |
---|
AbstractElementCompletionItem(String tagName,
S sourceElement,
G generator,
ICompletionRequest request) |
Modifier and Type | Method and Description |
---|---|
protected com.google.gson.JsonObject |
addResolveData(ICompletionRequest request,
String participantId)
Update completion item data for resolve support.
|
protected abstract org.eclipse.lsp4j.MarkupContent |
generateDocumentation()
Returns the completion item documentation and null otherwise.
|
protected abstract String |
generateFullElementContent(boolean generateEndTag)
Returns the full element content (ex :
|
protected G |
getGenerator()
Returns the generator to generate the full XML element content and null
otherwise.
|
protected ICompletionRequest |
getRequest()
Returns the completion request.
|
protected String |
getResolverParticipantId()
Returns the resolver participant id.
|
protected S |
getSourceElement()
Returns the source element (ex : a DOM element, a grammar element
declaration, etc) used to generate the completion item.
|
protected String |
getTagName()
Returns the tag name of the XML element completion item (ex : 'foo',
'x:foo').
|
protected static boolean |
hasContentAfterTagName(DOMElement element) |
static boolean |
isElementClosed(DOMElement element) |
static void |
updateEndTagName(DOMNode node,
int offset,
ISharedSettingsRequest request,
String tagName,
org.eclipse.lsp4j.CompletionItem completionItem) |
equals, getAdditionalTextEdits, getCommand, getCommitCharacters, getData, getDeprecated, getDetail, getDocumentation, getFilterText, getInsertText, getInsertTextFormat, getInsertTextMode, getKind, getLabel, getLabelDetails, getPreselect, getSortText, getTags, getTextEdit, getTextEditText, hashCode, setAdditionalTextEdits, setCommand, setCommitCharacters, setData, setDeprecated, setDetail, setDocumentation, setDocumentation, setDocumentation, setFilterText, setInsertText, setInsertTextFormat, setInsertTextMode, setKind, setLabel, setLabelDetails, setPreselect, setSortText, setTags, setTextEdit, setTextEditText, toString
public static final String UPDATE_END_TAG_NAME_FIELD
public AbstractElementCompletionItem(String tagName, S sourceElement, G generator, ICompletionRequest request)
protected String getTagName()
protected S getSourceElement()
protected G getGenerator()
protected ICompletionRequest getRequest()
protected static boolean hasContentAfterTagName(DOMElement element)
public static boolean isElementClosed(DOMElement element)
protected com.google.gson.JsonObject addResolveData(ICompletionRequest request, String participantId)
request
- the completion request.participantId
- the resolve participant id.protected abstract String generateFullElementContent(boolean generateEndTag)
generateEndTag
- true if the element end tag must be generated and
false otherwise.protected abstract org.eclipse.lsp4j.MarkupContent generateDocumentation()
public static void updateEndTagName(DOMNode node, int offset, ISharedSettingsRequest request, String tagName, org.eclipse.lsp4j.CompletionItem completionItem)
protected String getResolverParticipantId()
Copyright © 2022. All rights reserved.