Search in sources :

Example 16 with PerlTimeLogger

use of com.perl5.lang.perl.util.PerlTimeLogger in project Perl5-IDEA by Camelcade.

the class PerlUnicodeNamesCompletionProvider method addCompletions.

@Override
protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) {
    PerlSimpleCompletionProcessor completionProcessor = new PerlSimpleCompletionProcessor(parameters, result.caseInsensitive(), parameters.getPosition());
    Map<String, String> cache = myNamesCacheRef.get();
    if (cache == null) {
        LOG.debug("Cache been collected, re-init");
        cache = new HashMap<>();
        myCodePoint = 0;
        myNamesCacheRef = new SoftReference<>(cache);
    }
    PerlTimeLogger logger = PerlTimeLogger.create(LOG);
    fillCached(completionProcessor, cache);
    logger.debug("Filled cached unicode names");
    lazyCache(completionProcessor, cache);
    logger.debug("Lazily populated cache of unicode names");
    if (LOG.isDebugEnabled()) {
        LOG.debug("Cached entries: ", cache.size(), "; data size, mb: ", (float) myDataSize / 1024 / 1024);
    }
    completionProcessor.logStatus(getClass());
}
Also used : PerlTimeLogger(com.perl5.lang.perl.util.PerlTimeLogger) PerlSimpleCompletionProcessor(com.perl5.lang.perl.idea.completion.providers.processors.PerlSimpleCompletionProcessor)

Example 17 with PerlTimeLogger

use of com.perl5.lang.perl.util.PerlTimeLogger in project Perl5-IDEA by Camelcade.

the class PerlParserImpl method parseLight.

@Override
public void parseLight(IElementType root_, PsiBuilder builder_) {
    PerlTimeLogger logger = PerlTimeLogger.create(LOG);
    super.parseLight(root_, builder_);
    logger.trace("Light parsed ", root_, " ", PerlTimeLogger.kb(builder_.getOriginalText().length()), " kb");
}
Also used : PerlTimeLogger(com.perl5.lang.perl.util.PerlTimeLogger)

Aggregations

PerlTimeLogger (com.perl5.lang.perl.util.PerlTimeLogger)17 PsiElement (com.intellij.psi.PsiElement)10 PerlSimpleCompletionProcessor (com.perl5.lang.perl.idea.completion.providers.processors.PerlSimpleCompletionProcessor)8 PerlVariableCompletionProcessorImpl (com.perl5.lang.perl.idea.completion.providers.processors.PerlVariableCompletionProcessorImpl)4 PsiPerlMethod (com.perl5.lang.perl.psi.PsiPerlMethod)3 NotNull (org.jetbrains.annotations.NotNull)3 PerlVariableCompletionProcessor (com.perl5.lang.perl.idea.completion.providers.processors.PerlVariableCompletionProcessor)2 CompletionParameters (com.intellij.codeInsight.completion.CompletionParameters)1 CompletionResultSet (com.intellij.codeInsight.completion.CompletionResultSet)1 LookupElementBuilder (com.intellij.codeInsight.lookup.LookupElementBuilder)1 Project (com.intellij.openapi.project.Project)1 TextRange (com.intellij.openapi.util.TextRange)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 PsiLanguageInjectionHost (com.intellij.psi.PsiLanguageInjectionHost)1 ProcessingContext (com.intellij.util.ProcessingContext)1 PerlElementPatterns (com.perl5.lang.perl.idea.PerlElementPatterns)1 PerlCallStaticValue (com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlCallStaticValue)1 PerlCallValue (com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlCallValue)1 PerlCompletionProcessor (com.perl5.lang.perl.idea.completion.providers.processors.PerlCompletionProcessor)1 PerlFormattingBlock (com.perl5.lang.perl.idea.formatter.blocks.PerlFormattingBlock)1