mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-162109 "pl" should match "println" in completion
This commit is contained in:
@@ -711,4 +711,11 @@ public class NameUtilMatchingTest extends UsefulTestCase {
|
||||
assertPreference("GEN", "GetName", "GetExtendedName");
|
||||
assertPreference("*GEN", "GetName", "GetExtendedName");
|
||||
}
|
||||
|
||||
public void testPrintln() {
|
||||
assertMatches("pl", "println");
|
||||
assertMatches("pl", "printlnFoo");
|
||||
assertDoesntMatch("pl", "printlnx");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -385,7 +385,13 @@ public class NameUtil {
|
||||
if (!Character.isLetter(c)) {
|
||||
return false;
|
||||
}
|
||||
return i == 0 || !Character.isLetterOrDigit(text.charAt(i - 1));
|
||||
return i == 0 || !Character.isLetterOrDigit(text.charAt(i - 1)) || isHardCodedWordStart(text, i);
|
||||
}
|
||||
|
||||
private static boolean isHardCodedWordStart(String text, int i) {
|
||||
return text.charAt(i) == 'l' &&
|
||||
i < text.length() - 1 && text.charAt(i + 1) == 'n' &&
|
||||
(text.length() == i + 2 || isWordStart(text, i + 2));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user