Disable "Make constructor internal" for annotations #KT-17599 Fixed

This commit is contained in:
shiraji
2017-04-28 05:17:46 +03:00
committed by Mikhail Glukhikh
parent d542aef7e4
commit 6f94f45409
3 changed files with 14 additions and 1 deletions
@@ -119,5 +119,10 @@ open class ChangeVisibilityModifierIntention protected constructor(
}
}
class Internal : ChangeVisibilityModifierIntention(KtTokens.INTERNAL_KEYWORD)
class Internal : ChangeVisibilityModifierIntention(KtTokens.INTERNAL_KEYWORD) {
override fun applicabilityRange(element: KtDeclaration): TextRange? {
if (isAnnotationClassPrimaryConstructor(element)) return null
return super.applicabilityRange(element)
}
}
}
@@ -0,0 +1,2 @@
// IS_APPLICABLE: false
annotation class C<caret>(val v: Int)
@@ -2853,6 +2853,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/changeVisibility/internal"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("notForAnnotationClassPrimaryConstructor.kt")
public void testNotForAnnotationClassPrimaryConstructor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/internal/notForAnnotationClassPrimaryConstructor.kt");
doTest(fileName);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/internal/simple.kt");