UsePropertyAccessSyntaxIntention: minor bundle string cleanup

Because "getter" and "setter" UI strings shouldn't be hardcoded into
code

In scope of KTIJ-23892
Review: https://jetbrains.team/p/ij/reviews/100206

GitOrigin-RevId: c9026ae449cd1c87d27fde0cee7b0fe9318446af
This commit is contained in:
Nikita Bobko
2023-01-05 10:05:32 +00:00
committed by intellij-monorepo-bot
parent 03071ba3c3
commit 549b6c9d85
2 changed files with 6 additions and 6 deletions
@@ -1843,7 +1843,8 @@ to.raw.string.literal=To raw string literal
remove.underscores=Remove underscores
add.underscores=Add underscores
excluded.methods=Excluded methods
use.of.0.method.instead.of.property.access.syntax=Use of {0} method instead of property access syntax
use.of.getter.method.instead.of.property.access.syntax=Use of getter method instead of property access syntax
use.of.setter.method.instead.of.property.access.syntax=Use of setter method instead of property access syntax
use.property.access.syntax=Use property access syntax
convert.to.object.declaration=Convert to object declaration
comment=Comment
@@ -94,12 +94,11 @@ class UsePropertyAccessSyntaxInspection : IntentionBasedInspection<KtCallExpress
}
override fun inspectionProblemText(element: KtCallExpression): String {
val accessor = when (element.valueArguments.size) {
0 -> "getter"
1 -> "setter"
else -> null
return when (element.valueArguments.size) {
0 -> KotlinBundle.message("use.of.getter.method.instead.of.property.access.syntax")
1 -> KotlinBundle.message("use.of.setter.method.instead.of.property.access.syntax")
else -> error("getter or setter arg length can't be !in 0..1")
}
return KotlinBundle.message("use.of.0.method.instead.of.property.access.syntax", accessor.toString())
}
}