diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/IntroduceImportAliasIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/IntroduceImportAliasIntention.kt index 138b7e25658..01631acd9c4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/IntroduceImportAliasIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/IntroduceImportAliasIntention.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.idea.imports.canBeAddedToImport import org.jetbrains.kotlin.idea.refactoring.introduce.introduceImportAlias.KotlinIntroduceImportAliasHandler import org.jetbrains.kotlin.idea.references.mainReference import org.jetbrains.kotlin.idea.references.resolveMainReferenceToDescriptors +import org.jetbrains.kotlin.psi.KtInstanceExpressionWithLabel import org.jetbrains.kotlin.psi.KtNameReferenceExpression class IntroduceImportAliasIntention : SelfTargetingRangeIntention( @@ -18,6 +19,7 @@ class IntroduceImportAliasIntention : SelfTargetingRangeIntentionsuper.check() + } +} \ No newline at end of file diff --git a/idea/testData/intentions/introduceImportAlias/notApplicableThis.kt b/idea/testData/intentions/introduceImportAlias/notApplicableThis.kt new file mode 100644 index 00000000000..ebfcf4ee197 --- /dev/null +++ b/idea/testData/intentions/introduceImportAlias/notApplicableThis.kt @@ -0,0 +1,7 @@ +// IS_APPLICABLE: false +class Test { + fun check() {} + fun test2() { + this.check() + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java index d0031556d73..556602efee0 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -10125,6 +10125,16 @@ public class IntentionTestGenerated extends AbstractIntentionTest { runTest("idea/testData/intentions/introduceImportAlias/notApplicableStar.kt"); } + @TestMetadata("notApplicableSuper.kt") + public void testNotApplicableSuper() throws Exception { + runTest("idea/testData/intentions/introduceImportAlias/notApplicableSuper.kt"); + } + + @TestMetadata("notApplicableThis.kt") + public void testNotApplicableThis() throws Exception { + runTest("idea/testData/intentions/introduceImportAlias/notApplicableThis.kt"); + } + @TestMetadata("onImport.kt") public void testOnImport() throws Exception { runTest("idea/testData/intentions/introduceImportAlias/onImport.kt");