Skip to content

Commit

Permalink
Remove modifier rendering if it empty
Browse files Browse the repository at this point in the history
  • Loading branch information
atyrin committed Nov 14, 2023
1 parent 1fb8d31 commit 3fc052e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public class KotlinSignatureProvider(
p.modifier[sourceSet].takeIf { it !in ignoredModifiers }?.let {
if (it is JavaModifier.Empty) KotlinModifier.Open else it
}?.name?.let { keyword("$it ") }
p.modifiers()[sourceSet]?.toSignatureString()?.let { keyword(it) }
p.modifiers()[sourceSet]?.toSignatureString()?.takeIf { it.isNotEmpty() }?.let { keyword(it) }
if (p.isMutable()) keyword("var ") else keyword("val ")
list(p.generics, prefix = "<", suffix = "> ",
separatorStyles = mainStyles + TokenStyle.Punctuation,
Expand Down Expand Up @@ -303,7 +303,7 @@ public class KotlinSignatureProvider(
f.modifier[sourceSet]?.takeIf { it !in ignoredModifiers }?.let {
if (it is JavaModifier.Empty) KotlinModifier.Open else it
}?.name?.let { keyword("$it ") }
f.modifiers()[sourceSet]?.toSignatureString()?.let { keyword(it) }
f.modifiers()[sourceSet]?.toSignatureString()?.takeIf { it.isNotEmpty() }?.let { keyword(it) }
keyword("fun ")
list(
f.generics, prefix = "<", suffix = "> ",
Expand Down

0 comments on commit 3fc052e

Please sign in to comment.