Fix "Remove redundant qualifier name" for KtUserType with type parameter
#KT-30916 Fixed
This commit is contained in:
+1
-1
@@ -124,7 +124,7 @@ class RemoveRedundantQualifierNameQuickFix : LocalQuickFix {
|
||||
override fun applyFix(project: Project, descriptor: ProblemDescriptor) {
|
||||
val file = descriptor.psiElement.containingFile as KtFile
|
||||
val range = when (val element = descriptor.psiElement) {
|
||||
is KtUserType -> IntRange(element.startOffset, element.referenceExpression?.endOffset ?: return)
|
||||
is KtUserType -> IntRange(element.startOffset, element.endOffset)
|
||||
is KtDotQualifiedExpression -> IntRange(
|
||||
element.startOffset,
|
||||
element.getLastParentOfTypeInRowWithSelf<KtDotQualifiedExpression>()?.getQualifiedElementSelector()?.endOffset ?: return
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun main() {
|
||||
val a: kotlin<caret>.Pair<Int, Int>
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun main() {
|
||||
val a: Pair<Int, Int>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun main() {
|
||||
kotlin<caret>.Pair<Int, Int>(1, 1)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun main() {
|
||||
Pair<Int, Int>(1, 1)
|
||||
}
|
||||
+10
@@ -6469,6 +6469,16 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
|
||||
public void testTypeWithRuntime() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/removeRedundantQualifierName/typeWithRuntime.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("userTypeWithTypeParameter.kt")
|
||||
public void testUserTypeWithTypeParameter() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/removeRedundantQualifierName/userTypeWithTypeParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("withTypeParameter.kt")
|
||||
public void testWithTypeParameter() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/removeRedundantQualifierName/withTypeParameter.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/inspectionsLocal/removeRedundantSpreadOperator")
|
||||
|
||||
Reference in New Issue
Block a user