[kotlin] k2: use KotlinNamesValidator

^KTIJ-28946 Fixed

GitOrigin-RevId: 44ab38ef40abc92c2a84464fdb5f5256c2f20939
This commit is contained in:
aleksandrina-streltsova
2024-04-11 11:49:31 +00:00
committed by intellij-monorepo-bot
parent 2ee9a987b5
commit da233bc77b
6 changed files with 22 additions and 2 deletions
@@ -503,6 +503,11 @@ public abstract class ExtractionTestGenerated extends AbstractExtractionTest {
runTest("testData/refactoring/introduceVariable/introduceToFile.kt");
}
@TestMetadata("invalidInplaceName.kt")
public void testInvalidInplaceName() throws Exception {
runTest("testData/refactoring/introduceVariable/invalidInplaceName.kt");
}
@TestMetadata("It.kt")
public void testIt() throws Exception {
runTest("testData/refactoring/introduceVariable/It.kt");
@@ -0,0 +1,5 @@
// INPLACE_VARIABLE_NAME: val
/* this test is required to check KTIJ-28946, but the current expected result is not correct, see KTIJ-29410 */
fun test(): Int {
return <selection>1</selection>
}
@@ -0,0 +1,6 @@
// INPLACE_VARIABLE_NAME: val
/* this test is required to check KTIJ-28946, but the current expected result is not correct, see KTIJ-29410 */
fun test(): Int {
val val = 1
return val
}
@@ -16,6 +16,7 @@
<vetoRenameCondition implementation="org.jetbrains.kotlin.idea.refactoring.KotlinVetoRenameCondition"/>
<lang.namesValidator language="kotlin" implementationClass="org.jetbrains.kotlin.idea.refactoring.KotlinNamesValidator"/>
<renameInputValidator implementation="org.jetbrains.kotlin.idea.refactoring.rename.KotlinDeclarationRenameInputValidator"/>
<renameHandler implementation="org.jetbrains.kotlin.idea.refactoring.rename.KotlinRenameDispatcherHandler"/>
@@ -16,8 +16,6 @@
<applicationService serviceImplementation="org.jetbrains.kotlin.idea.refactoring.K1CommonRefactoringSettings"
serviceInterface="org.jetbrains.kotlin.idea.refactoring.KotlinCommonRefactoringSettings"/>
<lang.namesValidator language="kotlin" implementationClass="org.jetbrains.kotlin.idea.refactoring.KotlinNamesValidator"/>
<nameSuggestionProvider implementation="org.jetbrains.kotlin.idea.base.fe10.codeInsight.newDeclaration.Fe10KotlinNameSuggestionProvider"/>
<lang.refactoringSupport
@@ -501,6 +501,11 @@ public abstract class K2IntroduceVariableTestGenerated extends AbstractK2Introdu
runTest("../../idea/tests/testData/refactoring/introduceVariable/introduceToFile.kt");
}
@TestMetadata("invalidInplaceName.kt")
public void testInvalidInplaceName() throws Exception {
runTest("../../idea/tests/testData/refactoring/introduceVariable/invalidInplaceName.kt");
}
@TestMetadata("It.kt")
public void testIt() throws Exception {
runTest("../../idea/tests/testData/refactoring/introduceVariable/It.kt");