From a3291b8b2e9eddb9d72cdf0f522aa76e5c1b6b44 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 29 Aug 2012 13:46:38 +0200 Subject: [PATCH] middle matching with one char prefix --- .../codeInsight/completion/JavadocCompletionTest.java | 2 +- .../codeInsight/completion/SmartTypeCompletionTest.java | 4 ++-- .../testSrc/com/intellij/psi/util/NameUtilTest.java | 4 +++- .../util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavadocCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavadocCompletionTest.java index 10751eac788d..1f16310242b1 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavadocCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavadocCompletionTest.java @@ -54,7 +54,7 @@ public class JavadocCompletionTest extends LightFixtureCompletionTestCase { public void testNamesInMethod1() throws Exception { configureByFile("MethodTagName1.java"); - assertStringItems("see", "serialData", "since"); + assertStringItems("see", "serialData", "since", "class", "throws"); } public void testParamValueCompletion() throws Exception { diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java index 7bd52d3b8090..73a2b88c97ef 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java @@ -450,7 +450,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase { public void testNoUninitializedFieldsInConstructor() throws Throwable { configureByTestName(); - assertStringItems("aac", "aab"); + assertStringItems("aac", "aab", "hashCode"); } public void testFieldsSetInAnotherConstructor() throws Throwable { doTest(); } public void testFieldsSetAbove() throws Throwable { doTest(); } @@ -471,7 +471,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase { public void testVoidExpectedType() throws Throwable { configureByTestName(); assertStringItems("notify", "notifyAll", "wait", "wait", "wait", "getClass", "equals", "hashCode", "toString"); - type('e'); + type("eq"); assertEquals("equals", assertOneElement(getLookup().getItems()).getLookupString()); select(); checkResultByTestName(); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilTest.java b/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilTest.java index 22895b4a31f4..525353b9cdbd 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilTest.java @@ -252,7 +252,9 @@ public class NameUtilTest extends UsefulTestCase { assertMatches("*f", "format"); assertMatches("*f", "Format"); assertMatches("*Stri", "string"); - assertDoesntMatch("*f", "reformat"); + assertMatches("*f", "reformat"); + assertMatches("*f", "reformatCode"); + assertDoesntMatch("*fc", "reformatCode"); assertDoesntMatch("*sTC", "LazyClassTypeConstructor"); } diff --git a/platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java b/platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java index fb20e59f3fe9..f38fe9d28f36 100644 --- a/platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java +++ b/platform/util/src/com/intellij/psi/codeStyle/MinusculeMatcher.java @@ -211,7 +211,7 @@ public class MinusculeMatcher implements Matcher { } if (patternIndex + i >= myPattern.length) { - return i >= minFragment ? FList.emptyList().prepend(TextRange.from(nameIndex, i)) : null; + return FList.emptyList().prepend(TextRange.from(nameIndex, i)); } while (i >= minFragment) { int nextWordStart;