public class XmlCompletionContributor extends CompletionContributor
Modifier and Type | Field and Description |
---|---|
static com.intellij.codeInsight.completion.XmlCompletionContributor.EntityRefInsertHandler |
ENTITY_INSERT_HANDLER |
static java.lang.String |
TAG_NAME_COMPLETION_FEATURE |
static Key<java.lang.Boolean> |
WORD_COMPLETION_COMPATIBLE |
EP
Constructor and Description |
---|
XmlCompletionContributor() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
advertise(CompletionParameters parameters) |
void |
beforeCompletion(CompletionInitializationContext context)
Invoked before completion is started.
|
static LookupElement |
createLookupElement(XmlExtension.TagInfo tagInfo,
java.lang.String tailText,
java.lang.String namespacePrefix) |
void |
fillCompletionVariants(CompletionParameters parameters,
CompletionResultSet result)
The main contributor method that is supposed to provide completion variants to result, based on completion parameters.
|
static boolean |
isXmlNameCompletion(CompletionParameters parameters) |
duringCompletion, extend, forLanguage, forLanguageHonorDumbness, forParameters, handleAutoCompletionPossibility, handleEmptyLookup, invokeAutoPopup
public static final Key<java.lang.Boolean> WORD_COMPLETION_COMPATIBLE
public static final com.intellij.codeInsight.completion.XmlCompletionContributor.EntityRefInsertHandler ENTITY_INSERT_HANDLER
public static final java.lang.String TAG_NAME_COMPLETION_FEATURE
public static boolean isXmlNameCompletion(CompletionParameters parameters)
public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result)
CompletionContributor
CompletionProvider
s you could register by
invoking CompletionContributor.extend(CompletionType, ElementPattern, CompletionProvider)
from your contributor constructor,
matches the desired completion type and ElementPattern
with actual ones, and, depending on it, invokes those
completion providers.
If you want to implement this functionality directly by overriding this method, the following is for you.
Always check that parameters match your situation, and that completion type (CompletionParameters.getCompletionType()
is of your favourite kind. This method is run inside a read action. If you do any long activity non-related to PSI in it, please
ensure you call ProgressManager.checkCanceled()
often enough so that the completion process
can be cancelled smoothly when the user begins to type in the editor.
fillCompletionVariants
in class CompletionContributor
public static LookupElement createLookupElement(XmlExtension.TagInfo tagInfo, java.lang.String tailText, java.lang.String namespacePrefix)
public java.lang.String advertise(CompletionParameters parameters)
advertise
in class CompletionContributor
public void beforeCompletion(CompletionInitializationContext context)
CompletionContributor
beforeCompletion
in class CompletionContributor