55import com .intellij .openapi .editor .colors .TextAttributesKey ;
66import com .intellij .openapi .fileTypes .SyntaxHighlighterBase ;
77import com .intellij .psi .tree .IElementType ;
8+ import com .intellij .psi .tree .java .IKeywordElementType ;
89import fr .adrienbrault .idea .symfony2plugin .expressionLanguage .psi .ExpressionLanguageTypes ;
910import org .jetbrains .annotations .NotNull ;
1011
@@ -14,15 +15,13 @@ public class ExpressionLanguageSyntaxHighlighter extends SyntaxHighlighterBase {
1415
1516 public static final TextAttributesKey NUMBER = createTextAttributesKey ("NUMBER" , DefaultLanguageHighlighterColors .NUMBER );
1617 public static final TextAttributesKey STRING = createTextAttributesKey ("STRING" , DefaultLanguageHighlighterColors .STRING );
17- public static final TextAttributesKey ID = createTextAttributesKey ("ID" , DefaultLanguageHighlighterColors .IDENTIFIER );
1818 public static final TextAttributesKey IDENTIFIER = createTextAttributesKey ("IDENTIFIER" , DefaultLanguageHighlighterColors .IDENTIFIER );
19- public static final TextAttributesKey FUNCTION_CALL = createTextAttributesKey ("FUNCTION_CALL " , DefaultLanguageHighlighterColors .FUNCTION_CALL );
19+ public static final TextAttributesKey KEYWORD = createTextAttributesKey ("KEYWORD " , DefaultLanguageHighlighterColors .KEYWORD );
2020
2121 private static final TextAttributesKey [] NUMBER_KEYS = new TextAttributesKey []{NUMBER };
2222 private static final TextAttributesKey [] STRING_KEYS = new TextAttributesKey []{STRING };
23- private static final TextAttributesKey [] ID_KEYS = new TextAttributesKey []{ID };
2423 private static final TextAttributesKey [] IDENTIFIER_KEYS = new TextAttributesKey []{IDENTIFIER };
25- private static final TextAttributesKey [] FUNCTION_CALL_KEYS = new TextAttributesKey []{FUNCTION_CALL };
24+ private static final TextAttributesKey [] KEYWORD_KEYS = new TextAttributesKey []{KEYWORD };
2625 private static final TextAttributesKey [] EMPTY_KEYS = new TextAttributesKey [0 ];
2726
2827 @ NotNull
@@ -39,13 +38,21 @@ public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
3938 } else if (tokenType .equals (ExpressionLanguageTypes .STRING )) {
4039 return STRING_KEYS ;
4140 } else if (tokenType .equals (ExpressionLanguageTypes .ID )) {
42- return ID_KEYS ;
43- } else if (tokenType .equals (ExpressionLanguageTypes .IDENTIFIER )) {
4441 return IDENTIFIER_KEYS ;
45- } else if (tokenType .equals (ExpressionLanguageTypes .CALL_EXPR )) {
46- return FUNCTION_CALL_KEYS ;
47- } else {
48- return EMPTY_KEYS ;
42+ } else if (tokenType .equals (ExpressionLanguageTypes .TRUE )) {
43+ return KEYWORD_KEYS ;
44+ } else if (tokenType .equals (ExpressionLanguageTypes .FALSE )) {
45+ return KEYWORD_KEYS ;
46+ } else if (tokenType .equals (ExpressionLanguageTypes .NULL )) {
47+ return KEYWORD_KEYS ;
48+ } else if (tokenType .equals (ExpressionLanguageTypes .OP_IN )) {
49+ return KEYWORD_KEYS ;
50+ } else if (tokenType .equals (ExpressionLanguageTypes .OP_NOT_IN )) {
51+ return KEYWORD_KEYS ;
52+ } else if (tokenType .equals (ExpressionLanguageTypes .OP_MATCHES )) {
53+ return KEYWORD_KEYS ;
4954 }
55+
56+ return EMPTY_KEYS ;
5057 }
5158}
0 commit comments