diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt index 362d76ef799..9a737879e22 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt @@ -19,7 +19,10 @@ package org.jetbrains.kotlin.idea.intentions import com.intellij.codeInsight.intention.HighPriorityAction import com.intellij.openapi.editor.Editor import com.intellij.openapi.util.TextRange -import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithVisibility +import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.descriptors.Visibility import org.jetbrains.kotlin.idea.core.canBePrivate import org.jetbrains.kotlin.idea.core.canBeProtected import org.jetbrains.kotlin.idea.core.setVisibility @@ -29,6 +32,7 @@ import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.startOffset import org.jetbrains.kotlin.psi.psiUtil.visibilityModifier +import java.lang.IllegalArgumentException open class ChangeVisibilityModifierIntention protected constructor( val modifier: KtModifierKeywordToken diff --git a/idea/testData/intentions/changeVisibility/private/onAnnotation.kt b/idea/testData/intentions/changeVisibility/private/onAnnotation.kt new file mode 100644 index 00000000000..e7da8b4085c --- /dev/null +++ b/idea/testData/intentions/changeVisibility/private/onAnnotation.kt @@ -0,0 +1,5 @@ +annotation class Small(val i: Int, val s: String) + +@Small(1, "2") fun test1() { + +} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/private/onAnnotation.kt.after b/idea/testData/intentions/changeVisibility/private/onAnnotation.kt.after new file mode 100644 index 00000000000..c4bb083d66f --- /dev/null +++ b/idea/testData/intentions/changeVisibility/private/onAnnotation.kt.after @@ -0,0 +1,5 @@ +annotation class Small(val i: Int, val s: String) + +@Small(1, "2") private fun test1() { + +} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/private/onAnnotationParameter.kt b/idea/testData/intentions/changeVisibility/private/onAnnotationParameter.kt new file mode 100644 index 00000000000..15e8969c1fd --- /dev/null +++ b/idea/testData/intentions/changeVisibility/private/onAnnotationParameter.kt @@ -0,0 +1,5 @@ +annotation class Small(val i: Int, val s: String) + +@Small(1, "2") fun test1() { + +} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/private/onAnnotationParameter.kt.after b/idea/testData/intentions/changeVisibility/private/onAnnotationParameter.kt.after new file mode 100644 index 00000000000..034b6bf9d17 --- /dev/null +++ b/idea/testData/intentions/changeVisibility/private/onAnnotationParameter.kt.after @@ -0,0 +1,5 @@ +annotation class Small(val i: Int, val s: String) + +@Small(1, "2") private fun test1() { + +} \ 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 fb300870e96..c856f02746f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -2663,6 +2663,18 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } + @TestMetadata("onAnnotation.kt") + public void testOnAnnotation() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/private/onAnnotation.kt"); + doTest(fileName); + } + + @TestMetadata("onAnnotationParameter.kt") + public void testOnAnnotationParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/private/onAnnotationParameter.kt"); + doTest(fileName); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/private/simple.kt");