Change visibility modifier: now works on no-modifier type aliases #KT-15066 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
60fcdeb5ee
commit
be75ef919e
@@ -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 KtPrimaryConstructor -> declaration.valueParameterList?.let { TextRange.from(it.startOffset, 0) } //TODO: use constructor keyword if exist
|
||||||
is KtSecondaryConstructor -> declaration.getConstructorKeyword().textRange
|
is KtSecondaryConstructor -> declaration.getConstructorKeyword().textRange
|
||||||
is KtParameter -> declaration.valOrVarKeyword?.textRange
|
is KtParameter -> declaration.valOrVarKeyword?.textRange
|
||||||
|
is KtTypeAlias -> declaration.getTypeAliasKeyword()?.textRange
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<caret>typealias S = String
|
||||||
+1
@@ -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);
|
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")
|
@TestMetadata("notForAbstract.kt")
|
||||||
public void testNotForAbstract() throws Exception {
|
public void testNotForAbstract() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/private/notForAbstract.kt");
|
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");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/simple.kt");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeAlias.kt")
|
||||||
|
public void testTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/typeAlias.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user