Disable "Make constructor internal" for annotations #KT-17599 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
d542aef7e4
commit
6f94f45409
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user