mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-05 15:52:05 +00:00
Inline function: use "function" in GUI messages
This commit is contained in:
@@ -41,7 +41,7 @@ class KotlinInlineFunctionDialog(
|
||||
|
||||
init {
|
||||
myInvokedOnReference = reference != null
|
||||
title = RefactoringBundle.message("inline.method.title")
|
||||
title = "Inline function"
|
||||
init()
|
||||
}
|
||||
|
||||
@@ -51,23 +51,22 @@ class KotlinInlineFunctionDialog(
|
||||
val occurrencesString =
|
||||
if (occurrencesNumber > -1) " - $occurrencesNumber occurrence${if (occurrencesNumber == 1) "" else "s"}"
|
||||
else ""
|
||||
val methodText = "${function.nameAsSafeName}" + function.valueParameters.joinToString(prefix = "(", postfix = ")") {
|
||||
val functionText = "${function.nameAsSafeName}" + function.valueParameters.joinToString(prefix = "(", postfix = ")") {
|
||||
"${it.nameAsSafeName}: ${it.typeReference?.text}"
|
||||
} + (function.getReturnTypeReference()?.let { ": " + it.text } ?: "")
|
||||
return RefactoringBundle.message("inline.method.method.label", methodText, occurrencesString)
|
||||
return "Function $functionText $occurrencesString"
|
||||
}
|
||||
|
||||
override fun getBorderTitle(): String = RefactoringBundle.message("inline.method.border.title")
|
||||
override fun getBorderTitle() = "Inline"
|
||||
|
||||
override fun getInlineThisText(): String = RefactoringBundle.message("this.invocation.only.and.keep.the.method")
|
||||
override fun getInlineThisText() = "Inline this only and keep the function"
|
||||
|
||||
override fun getInlineAllText(): String = RefactoringBundle.message(
|
||||
if (function.isWritable) "all.invocations.and.remove.the.method"
|
||||
else "all.invocations.in.project"
|
||||
)
|
||||
override fun getInlineAllText() =
|
||||
if (function.isWritable) "Inline all and remove the function"
|
||||
else "All invocations in project"
|
||||
|
||||
override fun getKeepTheDeclarationText(): String =
|
||||
if (function.isWritable) RefactoringBundle.message("all.invocations.keep.the.method")
|
||||
if (function.isWritable) "Inline all and keep the function"
|
||||
else super.getKeepTheDeclarationText()
|
||||
|
||||
public override fun doAction() {
|
||||
|
||||
@@ -42,7 +42,7 @@ class KotlinInlineFunctionProcessor(
|
||||
private val deleteAfter: Boolean
|
||||
) : BaseRefactoringProcessor(project) {
|
||||
|
||||
private val commandName = RefactoringBundle.message("inline.method.command", DescriptiveNameUtil.getDescriptiveName(function))
|
||||
private val commandName = "Inlining function ${DescriptiveNameUtil.getDescriptiveName(function)}"
|
||||
|
||||
override fun findUsages(): Array<UsageInfo> {
|
||||
if (inlineThisOnly && reference != null) return arrayOf(UsageInfo(reference))
|
||||
@@ -75,8 +75,7 @@ class KotlinInlineFunctionProcessor(
|
||||
|
||||
override fun getElements() = arrayOf(function)
|
||||
|
||||
override fun getProcessedElementsHeader(): String =
|
||||
RefactoringBundle.message("inline.method.elements.header")
|
||||
override fun getProcessedElementsHeader() = "Function to inline"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user