mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
cleanup, don't cache matchers
This commit is contained in:
+2
-3
@@ -241,7 +241,7 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
public static void addAllClasses(CompletionParameters parameters,
|
||||
final CompletionResultSet result,
|
||||
final InheritorsHolder inheritors) {
|
||||
if (!isClassNamePossible(parameters.getPosition()) || !mayStartClassName(result, parameters.isRelaxedMatching())) return;
|
||||
if (!isClassNamePossible(parameters.getPosition()) || !mayStartClassName(result)) return;
|
||||
|
||||
if (mayShowAllClasses(parameters)) {
|
||||
JavaClassNameCompletionContributor.addAllClasses(parameters, parameters.getInvocationCount() <= 2, result.getPrefixMatcher(), new Consumer<LookupElement>() {
|
||||
@@ -385,14 +385,13 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
return Registry.is("show.all.classes.on.first.completion") || parameters.getInvocationCount() >= 2;
|
||||
}
|
||||
|
||||
public static boolean mayStartClassName(CompletionResultSet result, final boolean relaxedMatching) {
|
||||
public static boolean mayStartClassName(CompletionResultSet result) {
|
||||
String prefix = result.getPrefixMatcher().getPrefix();
|
||||
if (StringUtil.isEmpty(prefix)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return StringUtil.isCapitalized(prefix) ||
|
||||
relaxedMatching ||
|
||||
CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE == CodeInsightSettings.NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class JavaNoVariantsDelegator extends CompletionContributor {
|
||||
suggestCollectionUtilities(parameters, result, position);
|
||||
|
||||
if (parameters.getInvocationCount() <= 1 &&
|
||||
JavaCompletionContributor.mayStartClassName(result, false) &&
|
||||
JavaCompletionContributor.mayStartClassName(result) &&
|
||||
JavaCompletionContributor.isClassNamePossible(position)) {
|
||||
suggestNonImportedClasses(parameters, result);
|
||||
return;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class XmlBasicToClassNameDelegator extends AbstractBasicToClassNameDelega
|
||||
|
||||
@Override
|
||||
protected boolean isClassNameCompletionSupported(CompletionResultSet result, PsiFile file, PsiElement position) {
|
||||
if (!JavaCompletionContributor.mayStartClassName(result, false)) return false;
|
||||
if (!JavaCompletionContributor.mayStartClassName(result)) return false;
|
||||
|
||||
return file.getLanguage().isKindOf(StdLanguages.XML);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user