Search in sources :

Example 1 with PerlCallStaticValue

use of com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlCallStaticValue in project Perl5-IDEA by Camelcade.

the class PerlSubCallCompletionProvider method addCompletions.

@Override
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
    PsiElement position = parameters.getPosition();
    PsiElement method = position.getParent();
    assert method instanceof PsiPerlMethod;
    PerlCallValue perlValue = PerlCallValue.from(method);
    if (perlValue == null) {
        return;
    }
    PerlSimpleCompletionProcessor completionProcessor = new PerlSimpleCompletionProcessor(parameters, resultSet, position);
    PerlTimeLogger logger = PerlTimeLogger.create(LOG);
    if (perlValue instanceof PerlCallStaticValue && !((PerlCallStaticValue) perlValue).hasExplicitNamespace()) {
        PerlSubCompletionUtil.processBuiltInSubsLookupElements(completionProcessor);
        logger.debug("Processed built-in subs");
    }
    PerlSubCompletionUtil.processSubsCompletionsForCallValue(completionProcessor, perlValue, perlValue instanceof PerlCallStaticValue);
    logger.debug("Processed subs for call value");
    completionProcessor.logStatus(getClass());
}
Also used : PerlCallStaticValue(com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlCallStaticValue) PsiPerlMethod(com.perl5.lang.perl.psi.PsiPerlMethod) PerlCallValue(com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlCallValue) PerlTimeLogger(com.perl5.lang.perl.util.PerlTimeLogger) PerlSimpleCompletionProcessor(com.perl5.lang.perl.idea.completion.providers.processors.PerlSimpleCompletionProcessor) PsiElement(com.intellij.psi.PsiElement)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 PerlCallStaticValue (com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlCallStaticValue)1 PerlCallValue (com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlCallValue)1 PerlSimpleCompletionProcessor (com.perl5.lang.perl.idea.completion.providers.processors.PerlSimpleCompletionProcessor)1 PsiPerlMethod (com.perl5.lang.perl.psi.PsiPerlMethod)1 PerlTimeLogger (com.perl5.lang.perl.util.PerlTimeLogger)1