KotlinElementActionsFactory: adding empty annotations without parenthesises
This commit is contained in:
committed by
Nicolay Mitropolsky
parent
1669b6aa9f
commit
af63fcb3be
+2
-2
@@ -479,12 +479,12 @@ internal fun addAnnotationEntry(
|
||||
KtPsiFactory(target)
|
||||
.createAnnotationEntry(
|
||||
"@$annotationUseSiteTargetPrefix${request.qualifiedName}${
|
||||
request.attributes.mapIndexed { i, p ->
|
||||
request.attributes.takeIf { it.isNotEmpty() }?.mapIndexed { i, p ->
|
||||
if (!kotlinAnnotation && i == 0 && p.name == "value")
|
||||
renderAttributeValue(p.value).toString()
|
||||
else
|
||||
"${p.name} = ${renderAttributeValue(p.value)}"
|
||||
}.joinToString(", ", "(", ")")
|
||||
}?.joinToString(", ", "(", ")") ?: ""
|
||||
}"
|
||||
)
|
||||
)
|
||||
|
||||
@@ -272,7 +272,7 @@ class CommonIntentionActionsTest : LightPlatformCodeInsightFixtureTestCase() {
|
||||
import pkg.myannotation.JavaAnnotation
|
||||
|
||||
class Foo {
|
||||
@field:JavaAnnotation()
|
||||
@field:JavaAnnotation
|
||||
val bar: String = null
|
||||
}
|
||||
""".trimIndent(), true
|
||||
@@ -324,7 +324,7 @@ class CommonIntentionActionsTest : LightPlatformCodeInsightFixtureTestCase() {
|
||||
import pkg.myannotation.JavaAnnotation
|
||||
|
||||
class Foo {
|
||||
@JavaAnnotation()
|
||||
@JavaAnnotation
|
||||
val bar: String = null
|
||||
}
|
||||
""".trimIndent(), true
|
||||
|
||||
Reference in New Issue
Block a user