Skip to content

Commit

Permalink
Enable class kind to be open. (#956)
Browse files Browse the repository at this point in the history
Co-authored-by: Victor Ermolaev <[email protected]>
Co-authored-by: Alejandro Serrano <[email protected]>
  • Loading branch information
3 people authored Dec 15, 2021
1 parent 32ffdf0 commit 6e5255b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.psi.KtSuperTypeListEntry
import org.jetbrains.kotlin.psi.KtTypeParameter
import org.jetbrains.kotlin.psi.psiUtil.getValueParameters
import org.jetbrains.kotlin.psi.psiUtil.visibilityModifierType
import org.jetbrains.kotlin.lexer.KtTokens

/**
* <code>```"""|$`@annotations` $kind $name $`(typeParameters)` $`(params)` : $supertypes"} { $body } """.`class````</code>
Expand Down Expand Up @@ -82,7 +83,7 @@ import org.jetbrains.kotlin.psi.psiUtil.visibilityModifierType
* Transform.replace(
* replacing = it.element,
* newDeclaration =
* """|$`@annotations` $kind $name $`(typeParameters)` $`(params)` : $supertypes"} {
* """|$`@annotations` $kind $name $`(typeParameters)` $`(params)` : $supertypes {
* | $body
* | fun void test(): Unit =
* | println("Implemented by ΛRROW Meta!")
Expand Down Expand Up @@ -112,6 +113,7 @@ class ClassDeclaration(
(when {
value.isSealed() -> "sealed "
value.isData() -> "data "
value.hasModifier(KtTokens.OPEN_KEYWORD) -> "open "
else -> "/* empty? */"
} + value.getClassOrInterfaceKeyword()?.text).let(Name::identifier),
val `(typeParameters)`: ScopedList<KtTypeParameter> = ScopedList(prefix = "<", value = value.typeParameters, postfix = ">"),
Expand Down

0 comments on commit 6e5255b

Please sign in to comment.