mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
auto-import context variable declaration type when completing (IDEA-90157)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class Main<T extends Foo> {
|
||||
{
|
||||
List<Foo> list = new <caret>
|
||||
}
|
||||
}
|
||||
+13
@@ -1029,6 +1029,19 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
assertStringItems("Bar", "Goo");
|
||||
}
|
||||
|
||||
public void testAutoImportExpectedType() throws Throwable {
|
||||
boolean old = CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY;
|
||||
CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY = true;
|
||||
try {
|
||||
configureByTestName();
|
||||
performAction();
|
||||
myFixture.assertPreferredCompletionItems(1, "List", "ArrayList", "AbstractList");
|
||||
}
|
||||
finally {
|
||||
CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY = old;
|
||||
}
|
||||
}
|
||||
|
||||
public void testNoWrongSubstitutorFromStats() throws Throwable {
|
||||
doTest();
|
||||
FileDocumentManager.getInstance().saveDocument(myFixture.getEditor().getDocument());
|
||||
|
||||
Reference in New Issue
Block a user