mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
don't suggest lowercase non-imported classes in autopopup (IDEA-114348)
This commit is contained in:
@@ -23,6 +23,8 @@ import com.intellij.openapi.editor.RangeMarker;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.PostprocessReformattingAspect;
|
||||
import com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl;
|
||||
@@ -156,8 +158,13 @@ public class AllClassesGetter {
|
||||
|
||||
@Override
|
||||
public boolean process(PsiClass psiClass) {
|
||||
if (parameters.getInvocationCount() < 2 && PsiReferenceExpressionImpl.seemsScrambled(psiClass)) {
|
||||
return true;
|
||||
if (parameters.getInvocationCount() < 2) {
|
||||
if (PsiReferenceExpressionImpl.seemsScrambled(psiClass)) {
|
||||
return true;
|
||||
}
|
||||
if (!StringUtil.isCapitalized(psiClass.getName()) && !Registry.is("ide.completion.show.lower.case.classes")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
assert psiClass != null;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
public class Zoo {
|
||||
void foo() {
|
||||
abcdefg<caret>x
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1370,8 +1370,7 @@ class Foo {{
|
||||
myFixture.configureByText "a.java", """
|
||||
class Foo extends my<caret>
|
||||
"""
|
||||
myFixture.completeBasic()
|
||||
myFixture.type('\n')
|
||||
myFixture.complete(CompletionType.BASIC, 2)
|
||||
myFixture.checkResult '''import foo.myClass;
|
||||
|
||||
class Foo extends myClass
|
||||
@@ -1405,4 +1404,11 @@ class Bar {
|
||||
|
||||
public void testNoMathTargetMethods() { doAntiTest() }
|
||||
|
||||
public void testNoLowercaseClasses() {
|
||||
myFixture.addClass("package foo; public class abcdefgXxx {}")
|
||||
doAntiTest()
|
||||
myFixture.complete(CompletionType.BASIC, 2)
|
||||
assertStringItems('abcdefgXxx')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -232,6 +232,10 @@ ide.completion.show.better.matching.classes=true
|
||||
# suppress inspection "UnusedProperty"
|
||||
ide.completion.show.better.matching.classes.description=Show non-imported but good matching classes in basic completion
|
||||
|
||||
ide.completion.show.lower.case.classes=false
|
||||
# suppress inspection "UnusedProperty"
|
||||
ide.completion.show.lower.case.classes.description=Show non-imported classes starting with a lowercase letter in basic completion
|
||||
|
||||
ide.completion.delay.autopopup.until.completed=false
|
||||
# suppress inspection "UnusedProperty"
|
||||
ide.completion.delay.autopopup.until.completed.description=Controls if completion autopopup is shown immediately and populated in background, or delayed until all suggestion are calculated
|
||||
|
||||
Reference in New Issue
Block a user