different enum property rename: name --> ...
This commit is contained in:
@@ -20,7 +20,7 @@ import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.lexer.JetTokens
|
||||
import org.jetbrains.kotlin.psi.JetPsiFactory
|
||||
|
||||
public enum class JetValVar(val name: String) {
|
||||
public enum class JetValVar(val keywordName: String) {
|
||||
None("none") {
|
||||
override fun createKeyword(factory: JetPsiFactory) = null
|
||||
},
|
||||
@@ -31,7 +31,7 @@ public enum class JetValVar(val name: String) {
|
||||
override fun createKeyword(factory: JetPsiFactory) = factory.createVarKeyword()
|
||||
};
|
||||
|
||||
override fun toString(): String = name
|
||||
override fun toString(): String = keywordName
|
||||
|
||||
abstract fun createKeyword(factory: JetPsiFactory): PsiElement?
|
||||
}
|
||||
|
||||
+1
-1
@@ -334,7 +334,7 @@ data class ExtractableCodeDescriptor(
|
||||
val duplicates: List<DuplicateInfo> by lazy { findDuplicates() }
|
||||
}
|
||||
|
||||
enum class ExtractionTarget(val name: String) {
|
||||
enum class ExtractionTarget(val targetName: String) {
|
||||
FUNCTION("function") {
|
||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor) = true
|
||||
},
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ fun ExtractionGeneratorConfiguration.getDeclarationText(
|
||||
): String {
|
||||
val extractionTarget = generatorOptions.target
|
||||
if (!extractionTarget.isAvailable(descriptor)) {
|
||||
throw IllegalArgumentException("Can't generate ${extractionTarget.name}: ${descriptor.extractionData.codeFragmentText}")
|
||||
throw IllegalArgumentException("Can't generate ${extractionTarget.targetName}: ${descriptor.extractionData.codeFragmentText}")
|
||||
}
|
||||
|
||||
val builderTarget = when (extractionTarget) {
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ public class KotlinInplaceParameterIntroducer(
|
||||
val parameterName = currentName ?: parameter.getName()
|
||||
val parameterType = currentType ?: parameter.getTypeReference()!!.getText()
|
||||
descriptor = descriptor.copy(newParameterName = parameterName!!, newParameterTypeText = parameterType)
|
||||
val modifier = if (valVar != JetValVar.None) "${valVar.name} " else ""
|
||||
val modifier = if (valVar != JetValVar.None) "${valVar.keywordName} " else ""
|
||||
val defaultValue = if (withDefaultValue) " = ${newArgumentValue.getText()}" else ""
|
||||
|
||||
"$modifier$parameterName: $parameterType$defaultValue"
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ public class KotlinInplacePropertyIntroducer(
|
||||
if (availableTargets.size() > 1) {
|
||||
addPanelControl(
|
||||
ControlWrapper {
|
||||
val propertyKindComboBox = with(JComboBox(availableTargets.map { it.name.capitalize() }.toTypedArray())) {
|
||||
val propertyKindComboBox = with(JComboBox(availableTargets.map { it.targetName.capitalize() }.toTypedArray())) {
|
||||
addPopupMenuListener(
|
||||
object : PopupMenuListenerAdapter() {
|
||||
override fun popupMenuWillBecomeInvisible(e: PopupMenuEvent?) {
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ public abstract class AbstractJetExtractionTest() : JetLightCodeInsightFixtureTe
|
||||
file as JetFile
|
||||
|
||||
val extractionTarget = propertyTargets.single {
|
||||
it.name == InTextDirectivesUtils.findStringWithPrefixes(file.getText(), "// EXTRACTION_TARGET: ")
|
||||
it.targetName == InTextDirectivesUtils.findStringWithPrefixes(file.getText(), "// EXTRACTION_TARGET: ")
|
||||
}
|
||||
val explicitPreviousSibling = file.findElementByCommentPrefix("// SIBLING:")
|
||||
val helper = object : ExtractionEngineHelper(INTRODUCE_PROPERTY) {
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.j2k.ast
|
||||
|
||||
import org.jetbrains.kotlin.j2k.CodeBuilder
|
||||
|
||||
enum class Modifier(val name: String) {
|
||||
enum class Modifier(private val str: String) {
|
||||
PUBLIC("public"),
|
||||
PROTECTED("protected"),
|
||||
PRIVATE("private"),
|
||||
@@ -29,7 +29,7 @@ enum class Modifier(val name: String) {
|
||||
OVERRIDE("override"),
|
||||
INNER("inner");
|
||||
|
||||
public fun toKotlin(): String = name
|
||||
public fun toKotlin(): String = str
|
||||
}
|
||||
|
||||
val ACCESS_MODIFIERS = setOf(Modifier.PUBLIC, Modifier.PROTECTED, Modifier.PRIVATE, Modifier.INTERNAL)
|
||||
|
||||
Reference in New Issue
Block a user