mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
WI-62707 don't run inspection 'Duplicated char inside character class' when concatenated string can't be fully evaluated
GitOrigin-RevId: 7c7a1598996bc84511b79ed8e51ad0d24aaad339
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c920677a40
commit
61df548950
@@ -7,6 +7,8 @@ import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import org.intellij.lang.regexp.RegExpBundle;
|
||||
import org.intellij.lang.regexp.psi.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -34,6 +36,8 @@ public class DuplicateCharacterInClassInspection extends LocalInspectionTool {
|
||||
|
||||
@Override
|
||||
public void visitRegExpClass(RegExpClass regExpClass) {
|
||||
PsiFile file = regExpClass.getContainingFile();
|
||||
if (file == null || Boolean.TRUE.equals(file.getUserData(InjectedLanguageUtil.FRANKENSTEIN_INJECTION))) return;
|
||||
final HashSet<Object> seen = new HashSet<>();
|
||||
for (RegExpClassElement element : regExpClass.getElements()) {
|
||||
checkForDuplicates(element, seen);
|
||||
|
||||
Reference in New Issue
Block a user