Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed Apr 25, 2018
1 parent 7667021 commit af81beb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# EmmyLua for DevKt

[![Build Status](https://travis-ci.org/devkt-plugins/emmylua-devkt.svg?branch=master)](https://travis-ci.org/devkt-plugins/emmylua-devkt)

Lua plugin for DevKt based on [EmmyLua](https://github.com/EmmyLua/IntelliJ-EmmyLua)
7 changes: 7 additions & 0 deletions src/com/tang/intellij/devkt/lua/lua-devkt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.ice1000.devkt.openapi.*
import org.ice1000.devkt.openapi.ui.IconLoader
import org.ice1000.devkt.openapi.util.CompletionElement
import org.jetbrains.kotlin.com.intellij.psi.PsiElement
import org.jetbrains.kotlin.com.intellij.psi.StringEscapesTokenTypes
import org.jetbrains.kotlin.com.intellij.psi.tree.IElementType

class EmmyLua<T> : ExtendedDevKtLanguage<T>(
Expand Down Expand Up @@ -41,13 +42,19 @@ class EmmyLua<T> : ExtendedDevKtLanguage<T>(
"return",
"then",
"until",
"false",
"nil",
"true",
"goto",
"while"
).mapTo(HashSet()) { CompletionElement(it, type = "Keyword") }

override fun attributesOf(type: IElementType, colorScheme: ColorScheme<T>) = when (type) {
LuaTypes.DOC_COMMENT -> colorScheme.docComments
LuaTypes.BLOCK_COMMENT -> colorScheme.blockComments
LuaTypes.SHORT_COMMENT -> colorScheme.lineComments
StringEscapesTokenTypes.VALID_STRING_ESCAPE_TOKEN -> colorScheme.stringEscape
StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN -> colorScheme.unknown
LuaTypes.STRING -> colorScheme.string
LuaTypes.SEMI -> colorScheme.semicolon
LuaTypes.COLON -> colorScheme.colon
Expand Down

0 comments on commit af81beb

Please sign in to comment.