diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt index 9a737879e22..e6fd5bee093 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ChangeVisibilityModifierIntention.kt @@ -97,6 +97,7 @@ open class ChangeVisibilityModifierIntention protected constructor( is KtPrimaryConstructor -> declaration.valueParameterList?.let { TextRange.from(it.startOffset, 0) } //TODO: use constructor keyword if exist is KtSecondaryConstructor -> declaration.getConstructorKeyword().textRange is KtParameter -> declaration.valOrVarKeyword?.textRange + is KtTypeAlias -> declaration.getTypeAliasKeyword()?.textRange else -> null } } diff --git a/idea/testData/intentions/changeVisibility/private/noModifierTypeAlias.kt b/idea/testData/intentions/changeVisibility/private/noModifierTypeAlias.kt new file mode 100644 index 00000000000..f19ca2196c9 --- /dev/null +++ b/idea/testData/intentions/changeVisibility/private/noModifierTypeAlias.kt @@ -0,0 +1 @@ +typealias S = String \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/private/noModifierTypeAlias.kt.after b/idea/testData/intentions/changeVisibility/private/noModifierTypeAlias.kt.after new file mode 100644 index 00000000000..ff4ac8e06d0 --- /dev/null +++ b/idea/testData/intentions/changeVisibility/private/noModifierTypeAlias.kt.after @@ -0,0 +1 @@ +private typealias S = String \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/public/typeAlias.kt b/idea/testData/intentions/changeVisibility/public/typeAlias.kt new file mode 100644 index 00000000000..2f70ec791c9 --- /dev/null +++ b/idea/testData/intentions/changeVisibility/public/typeAlias.kt @@ -0,0 +1 @@ +internal typealias S = String \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/public/typeAlias.kt.after b/idea/testData/intentions/changeVisibility/public/typeAlias.kt.after new file mode 100644 index 00000000000..bbac0dd21f7 --- /dev/null +++ b/idea/testData/intentions/changeVisibility/public/typeAlias.kt.after @@ -0,0 +1 @@ +typealias S = String \ 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 13b881d0956..5e2edddfbf2 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -2796,6 +2796,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } + @TestMetadata("noModifierTypeAlias.kt") + public void testNoModifierTypeAlias() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/private/noModifierTypeAlias.kt"); + doTest(fileName); + } + @TestMetadata("notForAbstract.kt") public void testNotForAbstract() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/private/notForAbstract.kt"); @@ -2939,6 +2945,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/simple.kt"); doTest(fileName); } + + @TestMetadata("typeAlias.kt") + public void testTypeAlias() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/typeAlias.kt"); + doTest(fileName); + } } }