Search in sources :

Example 1 with PerlStringBareMixin

use of com.perl5.lang.perl.psi.mixins.PerlStringBareMixin in project Perl5-IDEA by Camelcade.

the class PerlSpellCheckingStrategy method getTokenizer.

@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
    if (STRING_CONTENT_TOKENSET.contains(PsiUtilCore.getElementType(element))) {
        PsiElement lightNameIdentifierOwner = PerlTargetElementEvaluatorEx2.getLightNameIdentifierOwner(element);
        if (lightNameIdentifierOwner != null) {
            return IDENTIFIER_TOKENIZER;
        }
        ;
        if (element.getParent() instanceof PerlStringBareMixin) {
            return TEXT_TOKENIZER;
        }
        PsiLanguageInjectionHost injectionHost = PsiTreeUtil.getParentOfType(element, PsiLanguageInjectionHost.class);
        if (PerlInjectionUtil.hasInjections(injectionHost)) {
            return EMPTY_TOKENIZER;
        }
        return TEXT_TOKENIZER;
    }
    return super.getTokenizer(element);
}
Also used : PerlStringBareMixin(com.perl5.lang.perl.psi.mixins.PerlStringBareMixin) PsiLanguageInjectionHost(com.intellij.psi.PsiLanguageInjectionHost) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 PsiLanguageInjectionHost (com.intellij.psi.PsiLanguageInjectionHost)1 PerlStringBareMixin (com.perl5.lang.perl.psi.mixins.PerlStringBareMixin)1 NotNull (org.jetbrains.annotations.NotNull)1