mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
if a prefix entered during autopopup matches only some scrambled class, don't cancel the lookup (IDEA-76928)
This commit is contained in:
@@ -55,14 +55,29 @@ public class JavaCharFilter extends CharFilter {
|
||||
|
||||
Object o = item.getObject();
|
||||
if (o instanceof PsiClass && ((PsiClass)o).getName().length() > lookup.itemPattern(item).length()) {
|
||||
if (PsiShortNamesCache.getInstance(file.getProject()).getClassesByName(lookup.itemPattern(item), file.getResolveScope()).length > 0) {
|
||||
return true;
|
||||
for (PsiClass aClass : PsiShortNamesCache.getInstance(file.getProject()).getClassesByName(lookup.itemPattern(item), file.getResolveScope())) {
|
||||
if (!isObfuscated(aClass)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean isObfuscated(PsiClass psiClass) {
|
||||
if (!(psiClass instanceof PsiCompiledElement)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String name = psiClass.getName();
|
||||
if (name == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return name.length() == 1 && Character.isLowerCase(name.charAt(0));
|
||||
}
|
||||
|
||||
public Result acceptChar(char c, final int prefixLength, final Lookup lookup) {
|
||||
if (!lookup.isCompletion()) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user