Propose convert to string template as inspection more frequent
This commit is contained in:
committed by
Stanislav Erokhin
parent
4c15642e2c
commit
57e47d1830
@@ -51,9 +51,9 @@ open class ConvertToStringTemplateIntention : SelfTargetingOffsetIndependentInte
|
||||
fun shouldSuggestToConvert(expression: KtBinaryExpression): Boolean {
|
||||
val entries = buildReplacement(expression).entries
|
||||
return entries.none { it is KtBlockStringTemplateEntry }
|
||||
&& !entries.all { it is KtLiteralStringTemplateEntry || it is KtEscapeStringTemplateEntry }
|
||||
&& entries.count { it is KtLiteralStringTemplateEntry } > 1
|
||||
&& !expression.textContains('\n')
|
||||
&& !entries.all { it is KtLiteralStringTemplateEntry || it is KtEscapeStringTemplateEntry }
|
||||
&& entries.count { it is KtLiteralStringTemplateEntry } >= 1
|
||||
&& !expression.textContains('\n')
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
||||
Reference in New Issue
Block a user