mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Unify names of String intentions
GitOrigin-RevId: 073001f58a6ab697b34cd3968b7d7de041e0267a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d48b99349b
commit
98c5dd2a8b
@@ -1734,7 +1734,7 @@ convert.template.to.concatenated.string=Convert template to concatenated string
|
||||
replace.with.a.foreach.function.call=Replace with a ''{0}'' function call
|
||||
convert.concatenation.to.raw.string=Convert concatenation to raw string
|
||||
convert.concatenation.to.template.before.text='String' concatenation can be converted to a template
|
||||
convert.concatenation.to.template=Convert 'String' concatenation to a template
|
||||
convert.concatenation.to.template=Convert concatenation to template
|
||||
convert.try.finally.to.use.before.text=try-finally can be replaced with 'use()'
|
||||
convert.try.finally.to.use=Replace 'try-finally' with 'use()'
|
||||
convert.to.unsafe.cast=Convert to unsafe cast
|
||||
@@ -1844,8 +1844,8 @@ flip.0=Flip ''{0}''
|
||||
flip.binary.expression=Flip binary expression
|
||||
flip.equals=Flip 'equals'
|
||||
replace.with.infix.function.call=Replace with infix function call
|
||||
to.ordinary.string.literal=To ordinary string literal
|
||||
to.raw.string.literal=To raw string literal
|
||||
convert.to.ordinary.string.literal=Convert to ordinary string literal
|
||||
convert.to.raw.string.literal=Convert to raw string literal
|
||||
remove.underscores=Remove underscores
|
||||
add.underscores=Add underscores
|
||||
excluded.methods=Excluded methods
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.psi.KtStringTemplateExpression
|
||||
internal class ToRawStringLiteralIntention : AbstractKotlinApplicableIntention<KtStringTemplateExpression>(
|
||||
KtStringTemplateExpression::class
|
||||
), LowPriorityAction {
|
||||
override fun getFamilyName() = KotlinBundle.message("to.raw.string.literal")
|
||||
override fun getFamilyName() = KotlinBundle.message("convert.to.raw.string.literal")
|
||||
|
||||
override fun getActionName(element: KtStringTemplateExpression) = familyName
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||
|
||||
class ToOrdinaryStringLiteralIntention : SelfTargetingOffsetIndependentIntention<KtStringTemplateExpression>(
|
||||
KtStringTemplateExpression::class.java,
|
||||
KotlinBundle.lazyMessage("to.ordinary.string.literal")
|
||||
KotlinBundle.lazyMessage("convert.to.ordinary.string.literal")
|
||||
), LowPriorityAction {
|
||||
companion object {
|
||||
private val TRIM_INDENT_FUNCTIONS = listOf(FqName("kotlin.text.trimIndent"), FqName("kotlin.text.trimMargin"))
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||
|
||||
class ToRawStringLiteralIntention : SelfTargetingOffsetIndependentIntention<KtStringTemplateExpression>(
|
||||
KtStringTemplateExpression::class.java,
|
||||
KotlinBundle.lazyMessage("to.raw.string.literal")
|
||||
KotlinBundle.lazyMessage("convert.to.raw.string.literal")
|
||||
), LowPriorityAction {
|
||||
override fun isApplicableTo(element: KtStringTemplateExpression): Boolean {
|
||||
if (PsiTreeUtil.nextLeaf(element) is PsiErrorElement) {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ class KotlinQuickFixIntentionPreviewTest : KotlinLightCodeInsightFixtureTestCase
|
||||
val code = "intention"
|
||||
println(<caret>"Hello World!" + code)
|
||||
}""".trimIndent(),
|
||||
"Convert 'String' concatenation to a template",
|
||||
"Convert concatenation to template",
|
||||
"""
|
||||
fun main() {
|
||||
val code = "intention"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// "Import" "false"
|
||||
// ERROR: Type 'String' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: To raw string literal
|
||||
// ACTION: Convert to raw string literal
|
||||
|
||||
package b
|
||||
|
||||
|
||||
+2
-2
@@ -1,14 +1,14 @@
|
||||
// "Add 1st parameter to function 'foo'" "false"
|
||||
// ACTION: Change parameter 'i1' type of function 'foo' to 'String'
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Create function 'foo'
|
||||
// ACTION: Do not show hints for current method
|
||||
// ACTION: Put arguments on separate lines
|
||||
// ACTION: To raw string literal
|
||||
// DISABLE-ERRORS
|
||||
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo(<caret>"", "", 3, 4, 5)
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
// "Create class 'Foo'" "false"
|
||||
// ACTION: Create function 'Foo'
|
||||
// ACTION: Add parameter to constructor 'Foo'
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Create function 'Foo'
|
||||
// ACTION: Create secondary constructor
|
||||
// ERROR: Too many arguments for public constructor Foo(a: Int) defined in Foo
|
||||
// ACTION: Put arguments on separate lines
|
||||
// ACTION: Remove argument
|
||||
// ACTION: To raw string literal
|
||||
// ERROR: Too many arguments for public constructor Foo(a: Int) defined in Foo
|
||||
|
||||
class Foo(a: Int)
|
||||
|
||||
fun test() {
|
||||
val a = Foo(2, <caret>"2")
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
// ACTION: Convert property initializer to getter
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to lazy property
|
||||
// ACTION: To raw string literal
|
||||
// ACTION: Convert to raw string literal
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
val str = "<caret>kjsghkjshtiurhuig"
|
||||
|
||||
// IGNORE_FIR
|
||||
// IGNORE_FIR
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// "Remove suppression" "false"
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Do not show hints for current method
|
||||
// ACTION: Specify type explicitly
|
||||
// ACTION: Split property declaration
|
||||
// ACTION: To raw string literal
|
||||
|
||||
fun a(i: Int) {
|
||||
@Suppress("<caret>MoveVariableDeclarationIntoWhen") val suppressed = 4
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// "Convert too long character literal to string" "false"
|
||||
// ACTION: Compiler warning 'UNUSED_EXPRESSION' options
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Introduce local variable
|
||||
// ACTION: To raw string literal
|
||||
// ERROR: Illegal escape: '\ '
|
||||
|
||||
fun foo() {
|
||||
"\ <caret>"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
// "class org.jetbrains.kotlin.idea.quickfix.AddArrayOfTypeFix" "false"
|
||||
// ACTION: Add names in comment to call arguments
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Create test
|
||||
// ACTION: Make internal
|
||||
// ACTION: Make private
|
||||
// ACTION: To raw string literal
|
||||
// ACTION: Add names in comment to call arguments
|
||||
|
||||
@ArrAnn(<caret>"123") class My
|
||||
@ArrAnn(<caret>"123") class My
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Convert string to character literal" "false"
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Enable a trailing comma by default in the formatter
|
||||
// ACTION: To raw string literal
|
||||
// ERROR: Incompatible types: String and Char
|
||||
fun test(c: Char) {
|
||||
when (c) {
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// "Let 'String' implement interface 'A'" "false"
|
||||
// ACTION: Change parameter 'a' type of function 'foo' to 'String'
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: To raw string literal
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Create function 'foo'
|
||||
// ERROR: Type mismatch: inferred type is String but A was expected
|
||||
|
||||
@@ -15,4 +15,4 @@ fun bar() {
|
||||
fun foo(a: A) {
|
||||
}
|
||||
|
||||
interface A
|
||||
interface A
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
// "Change parameter 'z' type of function 'foo' to '(Int) -> String'" "false"
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Do not show return expression hints
|
||||
// ACTION: Introduce local variable
|
||||
// ACTION: To raw string literal
|
||||
|
||||
fun foo(y: Int = 0, z: (Int) -> String = {""}) {
|
||||
foo {
|
||||
""<caret> as Int
|
||||
""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Change type of 'x' to 'String?'" "false"
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Converts the assignment statement to an expression
|
||||
// ACTION: Remove braces from 'if' statement
|
||||
// ACTION: To raw string literal
|
||||
// ERROR: Type mismatch: inferred type is String but Nothing? was expected
|
||||
// ERROR: Val cannot be reassigned
|
||||
fun foo(condition: Boolean) {
|
||||
@@ -10,4 +10,4 @@ fun foo(condition: Boolean) {
|
||||
if (condition) {
|
||||
x = "abc"<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
// "Change type of 'x' to 'String?'" "false"
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Converts the assignment statement to an expression
|
||||
// ACTION: Remove braces from 'if' statement
|
||||
// ACTION: To raw string literal
|
||||
// ERROR: Type mismatch: inferred type is String but Int? was expected
|
||||
fun foo(condition: Boolean) {
|
||||
var x: Int? = null
|
||||
if (condition) {
|
||||
x = "abc"<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
// "Change type of 'x' to 'String?'" "false"
|
||||
// ACTION: Convert to 'buildString' call
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Converts the assignment statement to an expression
|
||||
// ACTION: Remove braces from 'if' statement
|
||||
// ACTION: To raw string literal
|
||||
// ERROR: Type mismatch: inferred type is String but Int was expected
|
||||
fun foo(condition: Boolean) {
|
||||
var x = 1
|
||||
if (condition) {
|
||||
x = "abc"<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,14 +2,14 @@
|
||||
// ERROR: Type mismatch: inferred type is String but Array<String> was expected
|
||||
// ACTION: Add arrayOf wrapper
|
||||
// ACTION: Change parameter 'value' type of primary constructor of class 'Foo' to 'String'
|
||||
// ACTION: Convert to raw string literal
|
||||
// ACTION: Create test
|
||||
// ACTION: Extract 'Bar' from current file
|
||||
// ACTION: Make internal
|
||||
// ACTION: Make private
|
||||
// ACTION: To raw string literal
|
||||
// ACTION: Wrap with []
|
||||
|
||||
annotation class Foo(val value: Array<String>)
|
||||
|
||||
@Foo(value = "abc"<caret>)
|
||||
class Bar
|
||||
class Bar
|
||||
|
||||
Reference in New Issue
Block a user