QuickFix for USELESS_HIDDEN_IMPORT.

This commit is contained in:
Wojciech Lopata
2013-02-14 13:54:32 +01:00
committed by Andrey Breslav
parent 6cd8779126
commit 8fad23691f
4 changed files with 17 additions and 1 deletions
@@ -125,7 +125,9 @@ public class QuickFixes {
JetIntentionActionFactory unresolvedReferenceFactory = ImportClassAndFunFix.createFactory();
factories.put(UNRESOLVED_REFERENCE, unresolvedReferenceFactory);
factories.put(USELESS_SIMPLE_IMPORT, RemoveImportFix.createFactory());
JetIntentionActionFactory removeImportFixFactory = RemoveImportFix.createFactory();
factories.put(USELESS_SIMPLE_IMPORT, removeImportFixFactory);
factories.put(USELESS_HIDDEN_IMPORT, removeImportFixFactory);
factories.put(SUPERTYPE_NOT_INITIALIZED_DEFAULT, ChangeToConstructorInvocationFix.createFactory());
factories.put(FUNCTION_CALL_EXPECTED, ChangeToFunctionInvocationFix.createFactory());
@@ -0,0 +1,4 @@
// "Remove useless import for 'jet.List'" "true"
import jet.Double
class List {}
@@ -0,0 +1,5 @@
// "Remove useless import for 'jet.List'" "true"
import jet.Double
import jet.List<caret>
class List {}
@@ -726,6 +726,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/uselessImports"), Pattern.compile("^before(\\w+)\\.kt$"), true);
}
@TestMetadata("beforeRemoveUselessHiddenImport.kt")
public void testRemoveUselessHiddenImport() throws Exception {
doTest("idea/testData/quickfix/uselessImports/beforeRemoveUselessHiddenImport.kt");
}
@TestMetadata("beforeRemoveUselessImport.kt")
public void testRemoveUselessImport() throws Exception {
doTest("idea/testData/quickfix/uselessImports/beforeRemoveUselessImport.kt");