mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-completion] IDEA-381537 Unnecessary completion after constructor. Command Completion
GitOrigin-RevId: 121925c75aebd3656a6cb4086a01e1b52cc4cafd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ac9bb7f154
commit
73a4844481
+3
-1
@@ -82,7 +82,9 @@ public final class JavaMemberNameCompletionContributor extends CompletionContrib
|
||||
completeComponentName(lookupSet, component, result.getPrefixMatcher());
|
||||
}
|
||||
|
||||
if (PsiJavaPatterns.psiElement().nameIdentifierOf(PsiJavaPatterns.psiMethod().withParent(PsiClass.class)).accepts(position)) {
|
||||
if (PsiJavaPatterns.psiElement().nameIdentifierOf(PsiJavaPatterns.psiMethod().withParent(PsiClass.class)).accepts(position) &&
|
||||
!(PsiTreeUtil.prevVisibleLeaf(position) instanceof PsiJavaToken javaToken &&
|
||||
javaToken.getTokenType() == JavaTokenType.DOT)) {
|
||||
completeMethodName(lookupSet, parameters.getPosition().getParent(), result.getPrefixMatcher());
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.example;
|
||||
|
||||
public class Person {
|
||||
private String a;
|
||||
|
||||
public Person(String a).Pe<caret> {
|
||||
this.a = a;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.example;
|
||||
|
||||
public class Person {
|
||||
private String a;
|
||||
|
||||
public Person(String a).Pe<caret> {
|
||||
this.a = a;
|
||||
}
|
||||
}
|
||||
+6
@@ -3258,4 +3258,10 @@ public class NormalCompletionTest extends NormalCompletionTestCase {
|
||||
myFixture.completeBasic();
|
||||
myFixture.checkResultByFile(getTestName(false) + "_after.java");
|
||||
}
|
||||
|
||||
public void testDotInsideConstructor() {
|
||||
configureByTestName();
|
||||
myFixture.completeBasic();
|
||||
myFixture.checkResultByFile(getTestName(false) + "_after.java");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user