Minor fix for highlighting of JoinVarArgsContains inspection.

Upgraded to kotlin 1.3.50, intellij plugin 0.4.10, assertj 3.13.2, idea 2019.2.1
This commit is contained in:
2019-08-23 18:04:07 +02:00
parent a4535afbbb
commit 36f63d26d2
3 changed files with 12 additions and 14 deletions
@@ -14,7 +14,7 @@ import de.platon42.intellij.plugins.cajon.quickfixes.JoinVarArgsContainsQuickFix
class JoinVarArgsContainsInspection : AbstractAssertJInspection() {
companion object {
private const val DISPLAY_NAME = "Join variadic arguments of contains()/containsOnlyOnce()/doesNotContain()"
private const val DISPLAY_NAME = "Join arguments to variadic for contains()/containsOnlyOnce()/doesNotContain()"
private const val JOIN_VARARGS_MESSAGE = "Calls to same methods may be joined to variadic version"
private val MATCHERS = listOf(MethodNames.CONTAINS, MethodNames.CONTAINS_ONLY_ONCE, MethodNames.DOES_NOT_CONTAIN)
@@ -42,7 +42,7 @@ class JoinVarArgsContainsInspection : AbstractAssertJInspection() {
if (onlyAssertionCalls.count(methodMatcher::test) > 1) {
val outmostMethodCall = statement.findOutmostMethodCall() ?: return
val quickFix = JoinVarArgsContainsQuickFix(MATCHERS)
val textRange = TextRange(outmostMethodCall.qualifierExpression.textLength, outmostMethodCall.textLength)
val textRange = TextRange(assertThatCall.textLength, outmostMethodCall.textLength)
holder.registerProblem(outmostMethodCall, textRange, JOIN_VARARGS_MESSAGE, quickFix)
return
}