InsertCurlyBracesToTemplateIntention - no i18n
This commit is contained in:
@@ -290,8 +290,6 @@ remove.unnecessary.parentheses=Remove unnecessary parentheses
|
|||||||
remove.unnecessary.parentheses.family=Remove Unnecessary Parentheses
|
remove.unnecessary.parentheses.family=Remove Unnecessary Parentheses
|
||||||
remove.unnecessary.curly.brackets.from.string.template=Remove curly braces from variable
|
remove.unnecessary.curly.brackets.from.string.template=Remove curly braces from variable
|
||||||
remove.unnecessary.curly.brackets.from.string.template.family=Remove Curly Braces From Variable
|
remove.unnecessary.curly.brackets.from.string.template.family=Remove Curly Braces From Variable
|
||||||
insert.curly.brackets.to.string.template=Insert curly braces around variable
|
|
||||||
insert.curly.brackets.to.string.template.family=Insert Curly Braces Around Variable
|
|
||||||
add.name.to.argument.family=Add Name to Argument
|
add.name.to.argument.family=Add Name to Argument
|
||||||
add.name.to.argument.single=Add name to argument\: ''{0}''
|
add.name.to.argument.single=Add name to argument\: ''{0}''
|
||||||
add.name.to.argument.multiple=Add name to argument...
|
add.name.to.argument.multiple=Add name to argument...
|
||||||
|
|||||||
+2
-3
@@ -21,13 +21,12 @@ import org.jetbrains.kotlin.psi.JetSimpleNameStringTemplateEntry
|
|||||||
import org.jetbrains.kotlin.psi.JetPsiFactory
|
import org.jetbrains.kotlin.psi.JetPsiFactory
|
||||||
|
|
||||||
public class InsertCurlyBracesToTemplateIntention : JetSelfTargetingOffsetIndependentIntention<JetSimpleNameStringTemplateEntry>(
|
public class InsertCurlyBracesToTemplateIntention : JetSelfTargetingOffsetIndependentIntention<JetSimpleNameStringTemplateEntry>(
|
||||||
"insert.curly.brackets.to.string.template", javaClass()) {
|
javaClass(), "Insert curly braces around variable") {
|
||||||
|
|
||||||
override fun isApplicableTo(element: JetSimpleNameStringTemplateEntry): Boolean = true
|
override fun isApplicableTo(element: JetSimpleNameStringTemplateEntry): Boolean = true
|
||||||
|
|
||||||
override fun applyTo(element: JetSimpleNameStringTemplateEntry, editor: Editor) {
|
override fun applyTo(element: JetSimpleNameStringTemplateEntry, editor: Editor) {
|
||||||
val expression = element.getExpression()
|
val expression = element.getExpression() ?: return
|
||||||
if (expression == null) return
|
|
||||||
element.replace(JetPsiFactory(element).createBlockStringTemplateEntry(expression))
|
element.replace(JetPsiFactory(element).createBlockStringTemplateEntry(expression))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user