More tests for ChangeVisibilityModifierIntention
(cherry picked from commit e7cdba7)
This commit is contained in:
committed by
Nikolay Krasko
parent
1e9db3c23e
commit
28d187ca1a
@@ -19,7 +19,10 @@ package org.jetbrains.kotlin.idea.intentions
|
|||||||
import com.intellij.codeInsight.intention.HighPriorityAction
|
import com.intellij.codeInsight.intention.HighPriorityAction
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.util.TextRange
|
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.canBePrivate
|
||||||
import org.jetbrains.kotlin.idea.core.canBeProtected
|
import org.jetbrains.kotlin.idea.core.canBeProtected
|
||||||
import org.jetbrains.kotlin.idea.core.setVisibility
|
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.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.visibilityModifier
|
import org.jetbrains.kotlin.psi.psiUtil.visibilityModifier
|
||||||
|
import java.lang.IllegalArgumentException
|
||||||
|
|
||||||
open class ChangeVisibilityModifierIntention protected constructor(
|
open class ChangeVisibilityModifierIntention protected constructor(
|
||||||
val modifier: KtModifierKeywordToken
|
val modifier: KtModifierKeywordToken
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
annotation class Small(val i: Int, val s: String)
|
||||||
|
|
||||||
|
@Sma<caret>ll(1, "2") fun test1() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
annotation class Small(val i: Int, val s: String)
|
||||||
|
|
||||||
|
@Sma<caret>ll(1, "2") private fun test1() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
annotation class Small(val i: Int, val s: String)
|
||||||
|
|
||||||
|
@Small(<caret>1, "2") fun test1() {
|
||||||
|
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
annotation class Small(val i: Int, val s: String)
|
||||||
|
|
||||||
|
@Small(<caret>1, "2") private fun test1() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2663,6 +2663,18 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
|||||||
doTest(fileName);
|
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")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/private/simple.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/private/simple.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user