From 75c178b1c74c8bf1eb94da98c631168eefe05bb7 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Fri, 13 Apr 2018 10:41:15 +0200 Subject: [PATCH] RegExp: options can be member of branch (IDEA-190180) --- .../src/org/intellij/lang/regexp/RegExpElementTypes.java | 2 +- .../inspection/SingleCharAlternationInspectionTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpElementTypes.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpElementTypes.java index e12f38a0d3d3..afe637311c31 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpElementTypes.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpElementTypes.java @@ -45,7 +45,7 @@ public interface RegExpElementTypes { IElementType NUMBER = new RegExpElementType("NUMBER"); TokenSet ATOMS = TokenSet.create(CLOSURE, BOUNDARY, SIMPLE_CLASS, CLASS, CHAR, GROUP, PROPERTY, BACKREF, NAMED_GROUP_REF, - PY_COND_REF, NAMED_CHARACTER); + PY_COND_REF, NAMED_CHARACTER, SET_OPTIONS); TokenSet CLASS_ELEMENTS = TokenSet.create(CHAR, CHAR_RANGE, SIMPLE_CLASS, CLASS, INTERSECTION, PROPERTY); } diff --git a/RegExpSupport/test/org/intellij/lang/regexp/inspection/SingleCharAlternationInspectionTest.java b/RegExpSupport/test/org/intellij/lang/regexp/inspection/SingleCharAlternationInspectionTest.java index f5de087ff2f1..ea689e19d54c 100644 --- a/RegExpSupport/test/org/intellij/lang/regexp/inspection/SingleCharAlternationInspectionTest.java +++ b/RegExpSupport/test/org/intellij/lang/regexp/inspection/SingleCharAlternationInspectionTest.java @@ -32,6 +32,10 @@ public class SingleCharAlternationInspectionTest extends RegExpInspectionTestCas highlightTest("a|b|cc|d"); } + public void testNoWarnNoException() { + highlightTest("(?i)x|y"); + } + public void testQuickfix() { quickfixTest("x|y|z", "[xyz]", "Replace with '[xyz]'"); }