IDEA-152325 Smart completion should not suggest class fields in its this/super constructor call

This commit is contained in:
peter
2016-03-15 19:55:14 +01:00
parent a0a7c689ef
commit 28b7c2501a
10 changed files with 172 additions and 102 deletions
@@ -1,7 +1,7 @@
class SearchParameters {
public SearchParameters(PsiElement element) {
this(e<caret>);
this(e<caret>x);
}
public SearchParameters(final PsiElement element, final boolean checkDeep) {
@@ -0,0 +1,10 @@
class A {
final int field;
A(int field) {
this.field = field;
}
A(A delegate, int x) {
this(<caret>)
}
}
@@ -50,7 +50,7 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
}
public void testDelegatingConstructorCall() {
checkPreferredItems 0, 'element', 'equals'
checkPreferredItems 0, 'element'
}
public void testPreferAnnotationMethods() throws Throwable {
@@ -230,4 +230,9 @@ public class SecondSmartTypeCompletionTest extends LightFixtureCompletionTestCas
LookupManager.getInstance(getProject()).hideActiveLookup();
super.tearDown();
}
public void testNoThisFieldsInDelegatingConstructorCall() {
configure();
assertOrderedEquals(myFixture.getLookupElementStrings(), "delegate.field", "x");
}
}