Skip to content

Commit

Permalink
JS annotator improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
dinbtechit committed Jun 13, 2022
1 parent 7b8cfa2 commit 287d689
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.github.dinbtechit.vscodetheme.annotators

import com.intellij.lang.ecmascript6.psi.ES6FromClause
import com.intellij.lang.ecmascript6.psi.ES6ImportSpecifier
import com.intellij.lang.ecmascript6.psi.ES6ImportSpecifierAlias
import com.intellij.lang.javascript.psi.JSLoopStatement
import com.intellij.lang.javascript.psi.JSStatement
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors
import com.intellij.openapi.editor.colors.TextAttributesKey
import com.intellij.psi.PsiElement
Expand Down Expand Up @@ -38,9 +39,9 @@ class JSAnnotator : BaseAnnotator() {
var type: TextAttributesKey? = null
when (element.text) {
"package", "export", "import", "require", "module", "return" -> type = SECONDARY_KEYWORDS
"await","try", "throw", "catch", "finally", "yield", "break", "continue", "with",
"await", "try", "throw", "catch", "finally", "yield", "break", "continue", "with",
"if", "else", "switch", "case", "default" -> type = SECONDARY_KEYWORDS
"for", "while", "do" -> type = SECONDARY_KEYWORDS
"for", "while", "do" -> if (element.context is JSLoopStatement) type = SECONDARY_KEYWORDS
"from" -> if (element.parent is ES6FromClause) type = FROM_KEYWORD
"null", "undefined" -> type = JS_NULL
"console" -> type = JS_KEYWORD
Expand Down

0 comments on commit 287d689

Please sign in to comment.