public class JavaClassNameCompletionContributor extends CompletionContributor
Modifier and Type | Field and Description |
---|---|
static PsiJavaElementPattern.Capture<PsiElement> |
AFTER_NEW |
EP
Constructor and Description |
---|
JavaClassNameCompletionContributor() |
Modifier and Type | Method and Description |
---|---|
static void |
addAllClasses(CompletionParameters parameters,
boolean filterByScope,
PrefixMatcher matcher,
Consumer<? super LookupElement> consumer) |
static JavaPsiClassReferenceElement |
createClassLookupItem(PsiClass psiClass,
boolean inJavaContext) |
static java.util.List<JavaPsiClassReferenceElement> |
createClassLookupItems(PsiClass psiClass,
boolean withInners,
InsertHandler<JavaPsiClassReferenceElement> insertHandler,
Condition<? super PsiClass> condition) |
void |
fillCompletionVariants(CompletionParameters parameters,
CompletionResultSet _result)
The main contributor method that is supposed to provide completion variants to result, based on completion parameters.
|
java.lang.String |
handleEmptyLookup(CompletionParameters parameters,
Editor editor) |
advertise, beforeCompletion, duringCompletion, extend, forLanguage, forLanguageHonorDumbness, forParameters, handleAutoCompletionPossibility, invokeAutoPopup
public static final PsiJavaElementPattern.Capture<PsiElement> AFTER_NEW
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 void addAllClasses(CompletionParameters parameters, boolean filterByScope, PrefixMatcher matcher, Consumer<? super LookupElement> consumer)
public static JavaPsiClassReferenceElement createClassLookupItem(PsiClass psiClass, boolean inJavaContext)
public static java.util.List<JavaPsiClassReferenceElement> createClassLookupItems(PsiClass psiClass, boolean withInners, InsertHandler<JavaPsiClassReferenceElement> insertHandler, Condition<? super PsiClass> condition)
public java.lang.String handleEmptyLookup(CompletionParameters parameters, Editor editor)
handleEmptyLookup
in class CompletionContributor