Change visibility modifier: now works on no-modifier type aliases #KT-15066 Fixed

This commit is contained in:
mglukhikh
2017-01-23 14:57:28 +03:00
committed by Mikhail Glukhikh
parent 60fcdeb5ee
commit be75ef919e
6 changed files with 17 additions and 0 deletions
@@ -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
}
}
@@ -0,0 +1 @@
<caret>typealias S = String
@@ -0,0 +1 @@
private typealias S = String
@@ -0,0 +1 @@
<caret>internal typealias S = String
@@ -0,0 +1 @@
typealias S = String
@@ -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);
}
}
}