mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Extract variable: fix selection of container for enum entry constructor argument
^KTIJ-27683 Fixed GitOrigin-RevId: b0ecf01c88c4e45f25b0da2df36951733292fce6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
efd46d0c2e
commit
db7ffa9987
+5
@@ -747,6 +747,11 @@ public abstract class ExtractionTestGenerated extends AbstractExtractionTest {
|
||||
runTest("testData/refactoring/introduceVariable/dynamicType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumEntry.kt")
|
||||
public void testEnumEntry() throws Exception {
|
||||
runTest("testData/refactoring/introduceVariable/enumEntry.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("expressionBodyErrorType.kt")
|
||||
public void testExpressionBodyErrorType() throws Exception {
|
||||
runTest("testData/refactoring/introduceVariable/expressionBodyErrorType.kt");
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
enum class Color(val rgb: Int) {
|
||||
RED(<caret>0xFF0000),
|
||||
GREEN(0x00FF00),
|
||||
BLUE(0x0000FF)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
val rgb1 = 0xFF0000
|
||||
|
||||
enum class Color(val rgb: Int) {
|
||||
RED(rgb1),
|
||||
GREEN(0x00FF00),
|
||||
BLUE(0x0000FF)
|
||||
}
|
||||
+1
-1
@@ -226,7 +226,7 @@ abstract class KotlinIntroduceVariableHandler : RefactoringActionHandler {
|
||||
is KtBlockExpression -> true
|
||||
is KtWhenEntry -> place == parent.expression
|
||||
is KtDeclarationWithBody -> parent.bodyExpression == place
|
||||
is KtClassBody -> true
|
||||
is KtClassBody -> place !is KtEnumEntry
|
||||
is KtFile -> true
|
||||
else -> false
|
||||
}
|
||||
|
||||
+5
@@ -745,6 +745,11 @@ public abstract class K2IntroduceVariableTestGenerated extends AbstractK2Introdu
|
||||
runTest("../../idea/tests/testData/refactoring/introduceVariable/dynamicType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumEntry.kt")
|
||||
public void testEnumEntry() throws Exception {
|
||||
runTest("../../idea/tests/testData/refactoring/introduceVariable/enumEntry.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("expressionBodyErrorType.kt")
|
||||
public void testExpressionBodyErrorType() throws Exception {
|
||||
runTest("../../idea/tests/testData/refactoring/introduceVariable/expressionBodyErrorType.kt");
|
||||
|
||||
Reference in New Issue
Block a user