From 9cddd0d1a4c0b7eede01d665c0b36e4139f9a34a Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Wed, 17 Aug 2016 17:08:39 +0300 Subject: [PATCH] Renamed classes --- .../{AutoImportFix.kt => ImportFix.kt} | 42 +++++++++---------- .../idea/quickfix/KotlinReferenceImporter.kt | 2 +- .../kotlin/idea/quickfix/QuickFixRegistrar.kt | 18 ++++---- ...OverflowInImportInnerClassInCurrentFile.kt | 2 +- ...owInImportInnerClassInCurrentFile.kt.after | 2 +- .../autoImports/infixCallAndObject.kt | 2 +- .../autoImports/memberImportJavaField.test | 5 ++- .../autoImports/memberImportJavaMethod.test | 5 ++- .../memberImportNotForClassFunction.test | 4 +- .../memberImportNotForClassProperty.test | 4 +- .../memberImportNotForJavaNonStaticField.test | 4 +- ...memberImportNotForJavaNonStaticMethod.test | 4 +- .../memberImportNotForTopLevelFunction.test | 4 +- .../quickfix/autoImports/namelessClass.kt | 2 +- .../quickfix/autoImports/namelessFunction.kt | 2 +- .../quickfix/autoImports/namelessObject.kt | 2 +- .../quickfix/autoImports/namelessParameter.kt | 2 +- .../quickfix/autoImports/namelessProperty.kt | 2 +- .../noImportAlreadyImported.kt.after | 2 +- .../autoImports/noImportForAlreadyImported.kt | 2 +- ...noImportForFunInQualifiedNotFirst.after.kt | 2 +- ...rtForFunInQualifiedNotFirst.before.Main.kt | 2 +- .../quickfix/autoImports/noImportForIndex.kt | 2 +- .../autoImports/noImportForIndex.kt.after | 2 +- .../noImportForNestedInPrivate.after.kt | 2 +- .../noImportForNestedInPrivate.before.Main.kt | 2 +- .../noImportForPrivateClass.after.kt | 2 +- .../noImportForPrivateClass.before.Main.kt | 2 +- .../autoImports/noImportInImports.after.kt | 2 +- .../noImportInImports.before.Main.kt | 2 +- ...portInQualifiedExpressionNotFirst.after.kt | 2 +- ...QualifiedExpressionNotFirst.before.Main.kt | 2 +- ...ImportInQualifiedUserTypeNotFirst.after.kt | 2 +- ...InQualifiedUserTypeNotFirst.before.Main.kt | 2 +- ...InSafeQualifiedExpressionNotFirst.after.kt | 2 +- ...QualifiedExpressionNotFirst.before.Main.kt | 2 +- ...tsForClassInExcludedPackage.before.Main.kt | 2 +- .../noImportsForExcludedClass.before.Main.kt | 2 +- ...orFunctionInExcludedPackage.before.Main.kt | 2 +- .../quickfix/autoImports/notForThisLabel.kt | 2 +- .../autoImports/packageClass.before.Main.kt | 2 +- 41 files changed, 78 insertions(+), 76 deletions(-) rename idea/src/org/jetbrains/kotlin/idea/quickfix/{AutoImportFix.kt => ImportFix.kt} (89%) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/AutoImportFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/ImportFix.kt similarity index 89% rename from idea/src/org/jetbrains/kotlin/idea/quickfix/AutoImportFix.kt rename to idea/src/org/jetbrains/kotlin/idea/quickfix/ImportFix.kt index f5c161e748d..722bf0ee553 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/AutoImportFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/ImportFix.kt @@ -62,7 +62,7 @@ import java.util.* /** * Check possibility and perform fix for unresolved references. */ -internal abstract class AutoImportFixBase(expression: T) : +internal abstract class ImportFixBase(expression: T) : KotlinQuickFixAction(expression), HighPriorityAction, HintAction { private val modificationCountOnCreate = PsiModificationTracker.SERVICE.getInstance(element.project).modificationCount @@ -175,7 +175,7 @@ internal abstract class AutoImportFixBase(expression: T) : } } -internal abstract class AutoImportFixBaseDynamicContext(expression: T) : AutoImportFixBase(expression) { +internal abstract class OrdinaryImportFixBase(expression: T) : ImportFixBase(expression) { override fun fillCandidates( name: String, callTypeAndReceiver: CallTypeAndReceiver<*, *>, @@ -207,7 +207,7 @@ internal abstract class AutoImportFixBaseDynamicContext(expres } -internal class AutoImportFix(expression: KtSimpleNameExpression) : AutoImportFixBaseDynamicContext(expression) { +internal class ImportFix(expression: KtSimpleNameExpression) : OrdinaryImportFixBase(expression) { override fun getCallTypeAndReceiver() = CallTypeAndReceiver.detect(element) override val importNames: Collection = run { @@ -240,7 +240,7 @@ internal class AutoImportFix(expression: KtSimpleNameExpression) : AutoImportFix companion object : KotlinSingleIntentionActionFactory() { override fun createAction(diagnostic: Diagnostic) = - (diagnostic.psiElement as? KtSimpleNameExpression)?.let(::AutoImportFix) + (diagnostic.psiElement as? KtSimpleNameExpression)?.let { ImportFix(it) } override fun isApplicableForCodeFragment() = true @@ -249,7 +249,7 @@ internal class AutoImportFix(expression: KtSimpleNameExpression) : AutoImportFix } -internal class MissingInvokeAutoImportFix(expression: KtExpression) : AutoImportFixBaseDynamicContext(expression) { +internal class InvokeImportFix(expression: KtExpression) : OrdinaryImportFixBase(expression) { override val importNames = OperatorNameConventions.INVOKE.singletonList() override fun getCallTypeAndReceiver() = CallTypeAndReceiver.OPERATOR(element) @@ -258,14 +258,14 @@ internal class MissingInvokeAutoImportFix(expression: KtExpression) : AutoImport companion object : KotlinSingleIntentionActionFactory() { override fun createAction(diagnostic: Diagnostic) = - (diagnostic.psiElement as? KtExpression)?.let(::MissingInvokeAutoImportFix) + (diagnostic.psiElement as? KtExpression)?.let { InvokeImportFix(it) } private val ERRORS by lazy(LazyThreadSafetyMode.PUBLICATION) { QuickFixes.getInstance().getDiagnostics(this) } } } -internal open class MissingArrayAccessorAutoImportFix(element: KtArrayAccessExpression, override val importNames: Collection, private val showHint: Boolean) : - AutoImportFixBaseDynamicContext(element) { +internal open class ArrayAccessorImportFix(element: KtArrayAccessExpression, override val importNames: Collection, private val showHint: Boolean) : + OrdinaryImportFixBase(element) { override fun getCallTypeAndReceiver() = CallTypeAndReceiver.OPERATOR(element.arrayExpression!!) @@ -288,7 +288,7 @@ internal open class MissingArrayAccessorAutoImportFix(element: KtArrayAccessExpr val element = diagnostic.psiElement if (element is KtArrayAccessExpression && element.arrayExpression != null) { - return MissingArrayAccessorAutoImportFix(element, importName(diagnostic).singletonList(), true) + return ArrayAccessorImportFix(element, importName(diagnostic).singletonList(), true) } return null @@ -298,9 +298,9 @@ internal open class MissingArrayAccessorAutoImportFix(element: KtArrayAccessExpr } } -internal class MissingDelegateAccessorsAutoImportFix( +internal class DelegateAccessorsImportFix( element: KtExpression, override val importNames: Collection, private val solveSeveralProblems: Boolean) : - AutoImportFixBaseDynamicContext(element) { + OrdinaryImportFixBase(element) { override fun getCallTypeAndReceiver() = CallTypeAndReceiver.DELEGATE(element) override fun createAction(project: Project, editor: Editor): KotlinAddImportAction { @@ -326,22 +326,22 @@ internal class MissingDelegateAccessorsAutoImportFix( override fun createAction(diagnostic: Diagnostic): KotlinQuickFixAction? { return (diagnostic.psiElement as? KtExpression)?.let { - MissingDelegateAccessorsAutoImportFix(it, importNames(diagnostic.singletonList()), false) + DelegateAccessorsImportFix(it, importNames(diagnostic.singletonList()), false) } } override fun doCreateActionsForAllProblems(sameTypeDiagnostics: Collection): List { val element = sameTypeDiagnostics.first().psiElement val names = importNames(sameTypeDiagnostics) - return (element as? KtExpression)?.let { MissingDelegateAccessorsAutoImportFix(it, names, true) }.singletonOrEmptyList() + return (element as? KtExpression)?.let { DelegateAccessorsImportFix(it, names, true) }.singletonOrEmptyList() } private val ERRORS by lazy(LazyThreadSafetyMode.PUBLICATION) { QuickFixes.getInstance().getDiagnostics(this) } } } -internal class MissingComponentsAutoImportFix(element: KtExpression, override val importNames: Collection, private val solveSeveralProblems: Boolean) : - AutoImportFixBaseDynamicContext(element) { +internal class ComponentsImportFix(element: KtExpression, override val importNames: Collection, private val solveSeveralProblems: Boolean) : + OrdinaryImportFixBase(element) { override fun getCallTypeAndReceiver() = CallTypeAndReceiver.OPERATOR(element) override fun createAction(project: Project, editor: Editor): KotlinAddImportAction { @@ -360,7 +360,7 @@ internal class MissingComponentsAutoImportFix(element: KtExpression, override va override fun createAction(diagnostic: Diagnostic): KotlinQuickFixAction? { return (diagnostic.psiElement as? KtExpression)?.let { - MissingComponentsAutoImportFix(it, importNames(diagnostic.singletonList()), false) + ComponentsImportFix(it, importNames(diagnostic.singletonList()), false) } } @@ -368,14 +368,14 @@ internal class MissingComponentsAutoImportFix(element: KtExpression, override va val element = sameTypeDiagnostics.first().psiElement val names = importNames(sameTypeDiagnostics) val solveSeveralProblems = sameTypeDiagnostics.size > 1 - return (element as? KtExpression)?.let { MissingComponentsAutoImportFix(it, names, solveSeveralProblems) }.singletonOrEmptyList() + return (element as? KtExpression)?.let { ComponentsImportFix(it, names, solveSeveralProblems) }.singletonOrEmptyList() } private val ERRORS by lazy(LazyThreadSafetyMode.PUBLICATION) { QuickFixes.getInstance().getDiagnostics(this) } } } -internal class AutoImportMemberFix(expression: KtSimpleNameExpression) : AutoImportFixBase(expression) { +internal class ImportMemberFix(expression: KtSimpleNameExpression) : ImportFixBase(expression) { override fun getText() = "Import member" @@ -426,7 +426,7 @@ internal class AutoImportMemberFix(expression: KtSimpleNameExpression) : AutoImp companion object : KotlinSingleIntentionActionFactory() { override fun createAction(diagnostic: Diagnostic) = - (diagnostic.psiElement as? KtSimpleNameExpression)?.let(::AutoImportMemberFix) + (diagnostic.psiElement as? KtSimpleNameExpression)?.let(::ImportMemberFix) override fun isApplicableForCodeFragment() = true @@ -435,7 +435,7 @@ internal class AutoImportMemberFix(expression: KtSimpleNameExpression) : AutoImp } -object AutoImportForMissingOperatorFactory : KotlinSingleIntentionActionFactory() { +object ImportForMissingOperatorFactory : KotlinSingleIntentionActionFactory() { override fun createAction(diagnostic: Diagnostic): IntentionAction? { val element = diagnostic.psiElement as? KtExpression ?: return null val operatorDescriptor = Errors.OPERATOR_MODIFIER_REQUIRED.cast(diagnostic).a @@ -443,7 +443,7 @@ object AutoImportForMissingOperatorFactory : KotlinSingleIntentionActionFactory( when (name) { OperatorNameConventions.GET, OperatorNameConventions.SET -> { if (element is KtArrayAccessExpression) { - return object : MissingArrayAccessorAutoImportFix(element, name.singletonList(), false) { + return object : ArrayAccessorImportFix(element, name.singletonList(), false) { override fun getSupportedErrors() = Errors.OPERATOR_MODIFIER_REQUIRED.singletonList() } } diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt index 3e9d6de2454..31ab090bd42 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinReferenceImporter.kt @@ -87,7 +87,7 @@ class KotlinReferenceImporter : ReferenceImporter { val bindingContext = analyze(BodyResolveMode.PARTIAL) if (mainReference.resolveToDescriptors(bindingContext).isNotEmpty()) return false - val suggestions = AutoImportFix(this).computeSuggestions() + val suggestions = ImportFix(this).computeSuggestions() if (suggestions.distinctBy { it.importableFqName!! }.size != 1) return false diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt index cfc3501f310..14f0366547c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt @@ -128,20 +128,20 @@ class QuickFixRegistrar : QuickFixContributor { NON_PRIVATE_CONSTRUCTOR_IN_ENUM.registerFactory(removeModifierFactory) NON_PRIVATE_CONSTRUCTOR_IN_SEALED.registerFactory(removeModifierFactory) - UNRESOLVED_REFERENCE.registerFactory(AutoImportMemberFix) - UNRESOLVED_REFERENCE.registerFactory(AutoImportFix) + UNRESOLVED_REFERENCE.registerFactory(ImportMemberFix) + UNRESOLVED_REFERENCE.registerFactory(ImportFix) UNRESOLVED_REFERENCE.registerFactory(AddTestLibQuickFix) - UNRESOLVED_REFERENCE_WRONG_RECEIVER.registerFactory(AutoImportFix) + UNRESOLVED_REFERENCE_WRONG_RECEIVER.registerFactory(ImportFix) - FUNCTION_EXPECTED.registerFactory(MissingInvokeAutoImportFix) + FUNCTION_EXPECTED.registerFactory(InvokeImportFix) - DELEGATE_SPECIAL_FUNCTION_MISSING.registerFactory(MissingDelegateAccessorsAutoImportFix) - COMPONENT_FUNCTION_MISSING.registerFactory(MissingComponentsAutoImportFix) + DELEGATE_SPECIAL_FUNCTION_MISSING.registerFactory(DelegateAccessorsImportFix) + COMPONENT_FUNCTION_MISSING.registerFactory(ComponentsImportFix) - NO_GET_METHOD.registerFactory(MissingArrayAccessorAutoImportFix) - NO_SET_METHOD.registerFactory(MissingArrayAccessorAutoImportFix) + NO_GET_METHOD.registerFactory(ArrayAccessorImportFix) + NO_SET_METHOD.registerFactory(ArrayAccessorImportFix) CONFLICTING_IMPORT.registerFactory(RemovePsiElementSimpleFix.RemoveImportFactory) @@ -373,7 +373,7 @@ class QuickFixRegistrar : QuickFixContributor { NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION.registerFactory(ConstFixFactory) OPERATOR_MODIFIER_REQUIRED.registerFactory(AddModifierFixFactory(KtTokens.OPERATOR_KEYWORD)) - OPERATOR_MODIFIER_REQUIRED.registerFactory(AutoImportForMissingOperatorFactory) + OPERATOR_MODIFIER_REQUIRED.registerFactory(ImportForMissingOperatorFactory) INFIX_MODIFIER_REQUIRED.registerFactory(AddModifierFixFactory(KtTokens.INFIX_KEYWORD)) INFIX_MODIFIER_REQUIRED.registerFactory(InfixCallFix) diff --git a/idea/testData/quickfix/autoImports/checkNoStackOverflowInImportInnerClassInCurrentFile.kt b/idea/testData/quickfix/autoImports/checkNoStackOverflowInImportInnerClassInCurrentFile.kt index 78bfa16165b..915083f9ba3 100644 --- a/idea/testData/quickfix/autoImports/checkNoStackOverflowInImportInnerClassInCurrentFile.kt +++ b/idea/testData/quickfix/autoImports/checkNoStackOverflowInImportInnerClassInCurrentFile.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // KT-3165 Weird stack overflow in IDE // ERROR: Unresolved reference: Bar diff --git a/idea/testData/quickfix/autoImports/checkNoStackOverflowInImportInnerClassInCurrentFile.kt.after b/idea/testData/quickfix/autoImports/checkNoStackOverflowInImportInnerClassInCurrentFile.kt.after index 1001ab9d6c3..bbee5ddd5d7 100644 --- a/idea/testData/quickfix/autoImports/checkNoStackOverflowInImportInnerClassInCurrentFile.kt.after +++ b/idea/testData/quickfix/autoImports/checkNoStackOverflowInImportInnerClassInCurrentFile.kt.after @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // KT-3165 Weird stack overflow in IDE // ERROR: Unresolved reference: Bar // ERROR: Unresolved reference: SomeImpossibleName diff --git a/idea/testData/quickfix/autoImports/infixCallAndObject.kt b/idea/testData/quickfix/autoImports/infixCallAndObject.kt index b7d99138452..84892a0b982 100644 --- a/idea/testData/quickfix/autoImports/infixCallAndObject.kt +++ b/idea/testData/quickfix/autoImports/infixCallAndObject.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: infix package x diff --git a/idea/testData/quickfix/autoImports/memberImportJavaField.test b/idea/testData/quickfix/autoImports/memberImportJavaField.test index 108b4863715..ce8083ae9dd 100644 --- a/idea/testData/quickfix/autoImports/memberImportJavaField.test +++ b/idea/testData/quickfix/autoImports/memberImportJavaField.test @@ -9,14 +9,15 @@ fun f() { } -// FILE: Bar.java +// FILE: foo/Bar.java +package foo; public class Bar { public static final String foobar = "foobar"; } // FILE: first.after.kt -import Bar.foobar +import foo.Bar.foobar // "Import member" "true" // ERROR: Unresolved reference: foobar diff --git a/idea/testData/quickfix/autoImports/memberImportJavaMethod.test b/idea/testData/quickfix/autoImports/memberImportJavaMethod.test index f396444517e..8d06e530020 100644 --- a/idea/testData/quickfix/autoImports/memberImportJavaMethod.test +++ b/idea/testData/quickfix/autoImports/memberImportJavaMethod.test @@ -9,7 +9,8 @@ fun f() { } -// FILE: Bar.java +// FILE: foo/Bar.java +package foo; public class Bar { public static void foobar() @@ -19,7 +20,7 @@ public class Bar { } // FILE: first.after.kt -import Bar.foobar +import foo.Bar.foobar // "Import member" "true" // ERROR: Unresolved reference: foobar diff --git a/idea/testData/quickfix/autoImports/memberImportNotForClassFunction.test b/idea/testData/quickfix/autoImports/memberImportNotForClassFunction.test index b5de7a8d068..9dc332a146d 100644 --- a/idea/testData/quickfix/autoImports/memberImportNotForClassFunction.test +++ b/idea/testData/quickfix/autoImports/memberImportNotForClassFunction.test @@ -1,5 +1,5 @@ // FILE: main.before.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create function 'foobar' // ACTION: Rename reference @@ -20,7 +20,7 @@ class Foo { } //FILE: main.after.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create function 'foobar' // ACTION: Rename reference diff --git a/idea/testData/quickfix/autoImports/memberImportNotForClassProperty.test b/idea/testData/quickfix/autoImports/memberImportNotForClassProperty.test index 8bcb40b582c..a7ad17816af 100644 --- a/idea/testData/quickfix/autoImports/memberImportNotForClassProperty.test +++ b/idea/testData/quickfix/autoImports/memberImportNotForClassProperty.test @@ -1,5 +1,5 @@ // FILE: main.before.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create local variable 'foobar' // ACTION: Create property 'foobar' @@ -21,7 +21,7 @@ class Foo { } //FILE: main.after.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create local variable 'foobar' // ACTION: Create property 'foobar' diff --git a/idea/testData/quickfix/autoImports/memberImportNotForJavaNonStaticField.test b/idea/testData/quickfix/autoImports/memberImportNotForJavaNonStaticField.test index d6a52f08ba5..148381b1a20 100644 --- a/idea/testData/quickfix/autoImports/memberImportNotForJavaNonStaticField.test +++ b/idea/testData/quickfix/autoImports/memberImportNotForJavaNonStaticField.test @@ -1,5 +1,5 @@ // FILE: main.before.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create local variable 'foobar' // ACTION: Create property 'foobar' @@ -21,7 +21,7 @@ public class Foo { } //FILE: main.after.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create local variable 'foobar' // ACTION: Create property 'foobar' diff --git a/idea/testData/quickfix/autoImports/memberImportNotForJavaNonStaticMethod.test b/idea/testData/quickfix/autoImports/memberImportNotForJavaNonStaticMethod.test index a1158e7f15c..4980250472c 100644 --- a/idea/testData/quickfix/autoImports/memberImportNotForJavaNonStaticMethod.test +++ b/idea/testData/quickfix/autoImports/memberImportNotForJavaNonStaticMethod.test @@ -1,5 +1,5 @@ // FILE: main.before.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create function 'foobar' // ACTION: Rename reference @@ -21,7 +21,7 @@ public class Foo { } //FILE: main.after.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create function 'foobar' // ACTION: Rename reference diff --git a/idea/testData/quickfix/autoImports/memberImportNotForTopLevelFunction.test b/idea/testData/quickfix/autoImports/memberImportNotForTopLevelFunction.test index 19bb098181e..6a0d2f0f9bd 100644 --- a/idea/testData/quickfix/autoImports/memberImportNotForTopLevelFunction.test +++ b/idea/testData/quickfix/autoImports/memberImportNotForTopLevelFunction.test @@ -1,5 +1,5 @@ // FILE: main.before.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create function 'foobar' // ACTION: Import @@ -19,7 +19,7 @@ fun foobar() { } //FILE: main.after.kt -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportMemberFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportMemberFix" "false" // ERROR: Unresolved reference: foobar // ACTION: Create function 'foobar' // ACTION: Rename reference diff --git a/idea/testData/quickfix/autoImports/namelessClass.kt b/idea/testData/quickfix/autoImports/namelessClass.kt index 1e153a7545a..c53d3f96c66 100644 --- a/idea/testData/quickfix/autoImports/namelessClass.kt +++ b/idea/testData/quickfix/autoImports/namelessClass.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: TTT class { diff --git a/idea/testData/quickfix/autoImports/namelessFunction.kt b/idea/testData/quickfix/autoImports/namelessFunction.kt index 817c7ac0e6f..8b92fac249d 100644 --- a/idea/testData/quickfix/autoImports/namelessFunction.kt +++ b/idea/testData/quickfix/autoImports/namelessFunction.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: TTTTT // ERROR: Function declaration must have a name diff --git a/idea/testData/quickfix/autoImports/namelessObject.kt b/idea/testData/quickfix/autoImports/namelessObject.kt index 2f44b58733e..ce677d9f242 100644 --- a/idea/testData/quickfix/autoImports/namelessObject.kt +++ b/idea/testData/quickfix/autoImports/namelessObject.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: TTT object { diff --git a/idea/testData/quickfix/autoImports/namelessParameter.kt b/idea/testData/quickfix/autoImports/namelessParameter.kt index bdc60b8b3e5..1b0c223b4c3 100644 --- a/idea/testData/quickfix/autoImports/namelessParameter.kt +++ b/idea/testData/quickfix/autoImports/namelessParameter.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: TTT fun f(: Int) { diff --git a/idea/testData/quickfix/autoImports/namelessProperty.kt b/idea/testData/quickfix/autoImports/namelessProperty.kt index d139551646d..7efbfc13744 100644 --- a/idea/testData/quickfix/autoImports/namelessProperty.kt +++ b/idea/testData/quickfix/autoImports/namelessProperty.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: TTT val : Int diff --git a/idea/testData/quickfix/autoImports/noImportAlreadyImported.kt.after b/idea/testData/quickfix/autoImports/noImportAlreadyImported.kt.after index 405de98c64a..d9cc2ec8967 100644 --- a/idea/testData/quickfix/autoImports/noImportAlreadyImported.kt.after +++ b/idea/testData/quickfix/autoImports/noImportAlreadyImported.kt.after @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: some[12] // ERROR: No get method providing array access diff --git a/idea/testData/quickfix/autoImports/noImportForAlreadyImported.kt b/idea/testData/quickfix/autoImports/noImportForAlreadyImported.kt index 3c542e86f34..1fd143221c7 100644 --- a/idea/testData/quickfix/autoImports/noImportForAlreadyImported.kt +++ b/idea/testData/quickfix/autoImports/noImportForAlreadyImported.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: someFun // ERROR: Unresolved reference: test diff --git a/idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.after.kt b/idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.after.kt index d9e2113610f..dd795eecff0 100644 --- a/idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.after.kt +++ b/idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.after.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: externalFun package testing diff --git a/idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.before.Main.kt b/idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.before.Main.kt index a85ceb9ea69..a2d5a2c2561 100644 --- a/idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Rename reference // ERROR: Unresolved reference: externalFun diff --git a/idea/testData/quickfix/autoImports/noImportForIndex.kt b/idea/testData/quickfix/autoImports/noImportForIndex.kt index 0cc84a25aff..1f4898fb15f 100644 --- a/idea/testData/quickfix/autoImports/noImportForIndex.kt +++ b/idea/testData/quickfix/autoImports/noImportForIndex.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: some[12] // ERROR: No get method providing array access diff --git a/idea/testData/quickfix/autoImports/noImportForIndex.kt.after b/idea/testData/quickfix/autoImports/noImportForIndex.kt.after index 5d67f88bde2..745fe2444d9 100644 --- a/idea/testData/quickfix/autoImports/noImportForIndex.kt.after +++ b/idea/testData/quickfix/autoImports/noImportForIndex.kt.after @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" package Teting diff --git a/idea/testData/quickfix/autoImports/noImportForNestedInPrivate.after.kt b/idea/testData/quickfix/autoImports/noImportForNestedInPrivate.after.kt index 1ab43f27804..4d664cdaa79 100644 --- a/idea/testData/quickfix/autoImports/noImportForNestedInPrivate.after.kt +++ b/idea/testData/quickfix/autoImports/noImportForNestedInPrivate.after.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: Nested fun test() { diff --git a/idea/testData/quickfix/autoImports/noImportForNestedInPrivate.before.Main.kt b/idea/testData/quickfix/autoImports/noImportForNestedInPrivate.before.Main.kt index f4774a38c91..83bbff5488e 100644 --- a/idea/testData/quickfix/autoImports/noImportForNestedInPrivate.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportForNestedInPrivate.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Create local variable 'Nested' // ACTION: Create object 'Nested' // ACTION: Create parameter 'Nested' diff --git a/idea/testData/quickfix/autoImports/noImportForPrivateClass.after.kt b/idea/testData/quickfix/autoImports/noImportForPrivateClass.after.kt index a96b8ade797..6c72cb1fbc3 100644 --- a/idea/testData/quickfix/autoImports/noImportForPrivateClass.after.kt +++ b/idea/testData/quickfix/autoImports/noImportForPrivateClass.after.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: PrivateClass fun test() { diff --git a/idea/testData/quickfix/autoImports/noImportForPrivateClass.before.Main.kt b/idea/testData/quickfix/autoImports/noImportForPrivateClass.before.Main.kt index c58dfb1eba2..e9b4fcdaf5b 100644 --- a/idea/testData/quickfix/autoImports/noImportForPrivateClass.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportForPrivateClass.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Create local variable 'PrivateClass' // ACTION: Create object 'PrivateClass' // ACTION: Create parameter 'PrivateClass' diff --git a/idea/testData/quickfix/autoImports/noImportInImports.after.kt b/idea/testData/quickfix/autoImports/noImportInImports.after.kt index 40d2e66160d..d65c313b4de 100644 --- a/idea/testData/quickfix/autoImports/noImportInImports.after.kt +++ b/idea/testData/quickfix/autoImports/noImportInImports.after.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: SomeTest package testing diff --git a/idea/testData/quickfix/autoImports/noImportInImports.before.Main.kt b/idea/testData/quickfix/autoImports/noImportInImports.before.Main.kt index 4008cd3b328..38507c5e600 100644 --- a/idea/testData/quickfix/autoImports/noImportInImports.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportInImports.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Create annotation 'SomeTest' // ACTION: Create class 'SomeTest' // ACTION: Create interface 'SomeTest' diff --git a/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.after.kt b/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.after.kt index 994da28e35a..3b2c9b5440e 100644 --- a/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.after.kt +++ b/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.after.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: SomeTest package testing diff --git a/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.before.Main.kt b/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.before.Main.kt index 94f4e67315f..01f5f88a50d 100644 --- a/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportInQualifiedExpressionNotFirst.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Convert property initializer to getter // ACTION: Create class 'SomeTest' // ACTION: Rename reference diff --git a/idea/testData/quickfix/autoImports/noImportInQualifiedUserTypeNotFirst.after.kt b/idea/testData/quickfix/autoImports/noImportInQualifiedUserTypeNotFirst.after.kt index 29426499854..f9cf32e1920 100644 --- a/idea/testData/quickfix/autoImports/noImportInQualifiedUserTypeNotFirst.after.kt +++ b/idea/testData/quickfix/autoImports/noImportInQualifiedUserTypeNotFirst.after.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: SomeTest package testing diff --git a/idea/testData/quickfix/autoImports/noImportInQualifiedUserTypeNotFirst.before.Main.kt b/idea/testData/quickfix/autoImports/noImportInQualifiedUserTypeNotFirst.before.Main.kt index 57ee9c14a54..0d187168fbf 100644 --- a/idea/testData/quickfix/autoImports/noImportInQualifiedUserTypeNotFirst.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportInQualifiedUserTypeNotFirst.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Create interface 'SomeTest' // ERROR: Unresolved reference: SomeTest diff --git a/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.after.kt b/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.after.kt index 3714920386a..3d9748e92ad 100644 --- a/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.after.kt +++ b/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.after.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: SomeTest // ERROR: Expression expected, but a package name found // ACTION: Edit intention settings diff --git a/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt b/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt index 0b31d5c69c8..283f69a8a60 100644 --- a/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: SomeTest // ERROR: Expression expected, but a package name found // ACTION: Convert property initializer to getter diff --git a/idea/testData/quickfix/autoImports/noImportsForClassInExcludedPackage.before.Main.kt b/idea/testData/quickfix/autoImports/noImportsForClassInExcludedPackage.before.Main.kt index c5d7f740de3..760d92c4c51 100644 --- a/idea/testData/quickfix/autoImports/noImportsForClassInExcludedPackage.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportsForClassInExcludedPackage.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Convert property initializer to getter // ACTION: Create class 'SomeClass' // ACTION: Create function 'SomeClass' diff --git a/idea/testData/quickfix/autoImports/noImportsForExcludedClass.before.Main.kt b/idea/testData/quickfix/autoImports/noImportsForExcludedClass.before.Main.kt index 12a74633437..6621a5d3fe3 100644 --- a/idea/testData/quickfix/autoImports/noImportsForExcludedClass.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportsForExcludedClass.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Convert property initializer to getter // ACTION: Create class 'ExcludedClass' // ACTION: Create function 'ExcludedClass' diff --git a/idea/testData/quickfix/autoImports/noImportsForFunctionInExcludedPackage.before.Main.kt b/idea/testData/quickfix/autoImports/noImportsForFunctionInExcludedPackage.before.Main.kt index 4a7ef9fcd23..e669f5aaf25 100644 --- a/idea/testData/quickfix/autoImports/noImportsForFunctionInExcludedPackage.before.Main.kt +++ b/idea/testData/quickfix/autoImports/noImportsForFunctionInExcludedPackage.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Convert property initializer to getter // ACTION: Create function 'someFunction' // ACTION: Rename reference diff --git a/idea/testData/quickfix/autoImports/notForThisLabel.kt b/idea/testData/quickfix/autoImports/notForThisLabel.kt index b8183146e50..7f99ef327b1 100644 --- a/idea/testData/quickfix/autoImports/notForThisLabel.kt +++ b/idea/testData/quickfix/autoImports/notForThisLabel.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: @String fun refer() { diff --git a/idea/testData/quickfix/autoImports/packageClass.before.Main.kt b/idea/testData/quickfix/autoImports/packageClass.before.Main.kt index d3e8ce36611..253e1bbf204 100644 --- a/idea/testData/quickfix/autoImports/packageClass.before.Main.kt +++ b/idea/testData/quickfix/autoImports/packageClass.before.Main.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.kotlin.idea.quickfix.AutoImportFix" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Create function 'FooPackage' // ACTION: Create class 'FooPackage' // ACTION: Rename reference