mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
IDEA-162322 Completion missing for field in copy constructor
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.daemon.ImplicitUsageProvider;
|
||||
import com.intellij.codeInspection.dataFlow.value.DfaValueFactory;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.filters.ElementFilter;
|
||||
import com.intellij.psi.infos.CandidateInfo;
|
||||
@@ -64,6 +65,10 @@ class CheckInitialized implements ElementFilter {
|
||||
}
|
||||
|
||||
PsiElement parent = element.getParent();
|
||||
if (parent instanceof PsiReferenceExpression && !DfaValueFactory.isEffectivelyUnqualified((PsiReferenceExpression)parent)) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
while (parent != statement) {
|
||||
PsiElement next = parent.getParent();
|
||||
if (next instanceof PsiAssignmentExpression && parent == ((PsiAssignmentExpression)next).getLExpression()) {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class CopyConstructor {
|
||||
private final String ad;
|
||||
|
||||
public CopyConstructor(CopyConstructor other) {
|
||||
this.ad = other.a<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class CopyConstructor {
|
||||
private final String ad;
|
||||
|
||||
public CopyConstructor(CopyConstructor other) {
|
||||
this.ad = other.ad<caret>
|
||||
}
|
||||
}
|
||||
+2
@@ -1728,4 +1728,6 @@ class Bar {
|
||||
myFixture.assertPreferredCompletionItems 0, "dx", "doo", "Doo", "double"
|
||||
}
|
||||
|
||||
void testCopyConstructor() { doTest('\n') }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user