diff --git a/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java b/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java index 77246ec92763..2eade6903cd2 100644 --- a/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java +++ b/java/java-impl/src/com/intellij/spellchecker/LiteralExpressionTokenizer.java @@ -17,8 +17,10 @@ package com.intellij.spellchecker; import com.intellij.codeInsight.AnnotationUtil; import com.intellij.psi.JavaTokenType; +import com.intellij.psi.PsiLanguageInjectionHost; import com.intellij.psi.PsiLiteralExpression; import com.intellij.psi.PsiModifierListOwner; +import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil; import com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.spellchecker.inspections.PlainTextSplitter; @@ -30,8 +32,6 @@ import org.jetbrains.annotations.NotNull; import java.util.Collections; /** - * Created by IntelliJ IDEA. - * * @author shkate@jetbrains.com */ public class LiteralExpressionTokenizer extends Tokenizer { @@ -42,6 +42,8 @@ public class LiteralExpressionTokenizer extends Tokenizer return; // not a string literal } + if (InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)element)) return; + final PsiModifierListOwner listOwner = PsiTreeUtil.getParentOfType(element, PsiModifierListOwner.class); if (listOwner != null && AnnotationUtil.isAnnotated(listOwner, Collections.singleton(AnnotationUtil.NON_NLS), false, false)) { return;