mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
allow middle matches only with 3 typed prefix letters
This commit is contained in:
@@ -256,8 +256,16 @@ public class NameUtilTest extends UsefulTestCase {
|
||||
assertMatches("*f", "reformat");
|
||||
assertMatches("*f", "reformatCode");
|
||||
assertDoesntMatch("*fc", "reformatCode");
|
||||
assertDoesntMatch("*foc", "reformatCode");
|
||||
assertMatches("*forc", "reformatCode");
|
||||
assertDoesntMatch("*sTC", "LazyClassTypeConstructor");
|
||||
assertDoesntMatch("*Icon", "LEADING_CONSTRUCTOR");
|
||||
assertMatches("*I", "LEADING_CONSTRUCTOR");
|
||||
assertMatches("*i", "LEADING_CONSTRUCTOR");
|
||||
assertMatches("*in", "LEADING_CONSTRUCTOR");
|
||||
assertMatches("*ing", "LEADING_CONSTRUCTOR");
|
||||
assertDoesntMatch("*inc", "LEADING_CONSTRUCTOR");
|
||||
assertDoesntMatch("*ico", "drawLinePickedOut");
|
||||
}
|
||||
|
||||
public void testMiddleMatchingUnderscore() {
|
||||
|
||||
@@ -303,10 +303,10 @@ public class MinusculeMatcher implements Matcher {
|
||||
return null;
|
||||
}
|
||||
|
||||
// middle matches have to be at least of length 2, to prevent too many irrelevant matches
|
||||
// middle matches have to be at least of length 3, to prevent too many irrelevant matches
|
||||
int minFragment = isPatternChar(patternIndex - 1, '*') && !isWildcard(patternIndex + 1) &&
|
||||
Character.isLetterOrDigit(name.charAt(nameIndex)) && !NameUtil.isWordStart(name, nameIndex)
|
||||
? 2 : 1;
|
||||
? 3 : 1;
|
||||
int i = 1;
|
||||
boolean ignoreCase = myOptions != NameUtil.MatchingCaseSensitivity.ALL;
|
||||
while (nameIndex + i < name.length() &&
|
||||
|
||||
Reference in New Issue
Block a user