RegExp: options can be member of branch (IDEA-190180)

This commit is contained in:
Bas Leijdekkers
2018-04-13 10:47:12 +02:00
parent be39af2f20
commit 75c178b1c7
2 changed files with 5 additions and 1 deletions
@@ -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);
}
@@ -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("<warning descr=\"Single character alternation in RegExp\">x|y|z</warning>", "[xyz]", "Replace with '[xyz]'");
}