Skip to content

Commit

Permalink
Add some Kotlin types and fixed switch
Browse files Browse the repository at this point in the history
  • Loading branch information
jaresty committed Oct 11, 2024
1 parent 02db7ce commit e5ef917
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lang/kotlin/kotlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
code.language: kotlin
"""

# Java Modifies
ctx.lists["user.code_keyword"] = {
"var": "var ",
"val": "val ",
"lateinit": "lateinit ",
"public": "public ",
"private": "private ",
"protected": "protected ",
"static": "static ",
"companion object": "companion object ",
"synchronized": "synchronized ",
"volatile": "volatile ",
"transient": "transient ",
Expand Down Expand Up @@ -135,11 +134,11 @@ def code_state_else_if():
actions.user.insert_between("else if (", ") ")

def code_state_else():
actions.user.insert_between(" else {", "}")
actions.user.insert_between("else {", "}")
actions.key("enter")

def code_state_switch():
actions.user.insert_between("switch (", ") ")
actions.user.insert_between("when (", ") ") # Kotlin uses 'when' for switch

def code_state_case():
actions.insert("case \nbreak;")
Expand Down

0 comments on commit e5ef917

Please sign in to comment.