From 8d4fc535982c8b9a9a7d3b27d4b9de0e9488d710 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Wed, 22 Oct 2014 10:52:22 +0200 Subject: [PATCH] RegExp: completion for horizontal and vertical whitespace escape sequences --- .../intellij/lang/regexp/DefaultRegExpPropertiesProvider.java | 4 ++++ RegExpSupport/test/test/RegExpCompletionTest.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RegExpSupport/src/org/intellij/lang/regexp/DefaultRegExpPropertiesProvider.java b/RegExpSupport/src/org/intellij/lang/regexp/DefaultRegExpPropertiesProvider.java index 9f23654c710c..844a42edb7a0 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/DefaultRegExpPropertiesProvider.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/DefaultRegExpPropertiesProvider.java @@ -89,8 +89,12 @@ public final class DefaultRegExpPropertiesProvider { private final String[][] myCharacterClasses = { {"d", "digit: [0-9]"}, {"D", "nondigit: [^0-9]"}, + {"h", "horizontal whitespace character: [ \\t\\xA0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000]"}, + {"H", "non-horizontal whitespace character: [^\\h]"}, {"s", "whitespace [ \\t\\n\\x0B\\f\\r]"}, {"S", "non-whitespace [^\\s]"}, + {"v", "vertical whitespace character: [\\n\\x0B\\f\\r\\x85\\u2028\\u2029]"}, + {"V", "non-vertical whitespace character: [^\\v]"}, {"w", "word character [a-zA-Z_0-9]"}, {"W", "nonword character [^\\w]"}, {"b", "word boundary"}, diff --git a/RegExpSupport/test/test/RegExpCompletionTest.java b/RegExpSupport/test/test/RegExpCompletionTest.java index a408a540a99a..5e90be4a485a 100644 --- a/RegExpSupport/test/test/RegExpCompletionTest.java +++ b/RegExpSupport/test/test/RegExpCompletionTest.java @@ -58,7 +58,7 @@ public class RegExpCompletionTest extends CodeInsightFixtureTestCase { private void doBackSlashVariantsTest() throws Throwable { java.util.List nameList = new ArrayList(Arrays.asList("d", "D", "s", "S", "w", "W", "b", "B", "A", "G", "Z", "z", "Q", "E", - "t", "n", "r", "f", "a", "e")); + "t", "n", "r", "f", "a", "e", "h", "H", "v", "V")); for (String[] stringArray : DefaultRegExpPropertiesProvider.getInstance().getAllKnownProperties()) { nameList.add("p{" + stringArray[0] + "}"); }