public class JavaClassReferenceCompletionContributor extends CompletionContributor
EP
Constructor and Description |
---|
JavaClassReferenceCompletionContributor() |
Modifier and Type | Method and Description |
---|---|
void |
duringCompletion(CompletionInitializationContext context)
Invoked in a read action in parallel to the completion process.
|
void |
fillCompletionVariants(CompletionParameters parameters,
CompletionResultSet result)
The main contributor method that is supposed to provide completion variants to result, based on completion parameters.
|
static JavaClassReference |
findJavaClassReference(PsiFile file,
int offset) |
advertise, beforeCompletion, extend, forLanguage, forLanguageHonorDumbness, forParameters, handleAutoCompletionPossibility, handleEmptyLookup, invokeAutoPopup
public JavaClassReferenceCompletionContributor()
public void duringCompletion(CompletionInitializationContext context)
CompletionContributor
CompletionInitializationContext.setReplacementOffset(int)
)
if it takes too much time to spend it in CompletionContributor.beforeCompletion(CompletionInitializationContext)
,
e.g. doing PsiElement.findReferenceAt(int)
Guaranteed to be invoked before any lookup element is selectedduringCompletion
in class CompletionContributor
context
- contextpublic 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 JavaClassReference findJavaClassReference(PsiFile file, int offset)