5
5
import com .intellij .openapi .editor .colors .TextAttributesKey ;
6
6
import com .intellij .openapi .fileTypes .SyntaxHighlighterBase ;
7
7
import com .intellij .psi .tree .IElementType ;
8
+ import com .intellij .psi .tree .java .IKeywordElementType ;
8
9
import fr .adrienbrault .idea .symfony2plugin .expressionLanguage .psi .ExpressionLanguageTypes ;
9
10
import org .jetbrains .annotations .NotNull ;
10
11
@@ -14,15 +15,13 @@ public class ExpressionLanguageSyntaxHighlighter extends SyntaxHighlighterBase {
14
15
15
16
public static final TextAttributesKey NUMBER = createTextAttributesKey ("NUMBER" , DefaultLanguageHighlighterColors .NUMBER );
16
17
public static final TextAttributesKey STRING = createTextAttributesKey ("STRING" , DefaultLanguageHighlighterColors .STRING );
17
- public static final TextAttributesKey ID = createTextAttributesKey ("ID" , DefaultLanguageHighlighterColors .IDENTIFIER );
18
18
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 );
20
20
21
21
private static final TextAttributesKey [] NUMBER_KEYS = new TextAttributesKey []{NUMBER };
22
22
private static final TextAttributesKey [] STRING_KEYS = new TextAttributesKey []{STRING };
23
- private static final TextAttributesKey [] ID_KEYS = new TextAttributesKey []{ID };
24
23
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 };
26
25
private static final TextAttributesKey [] EMPTY_KEYS = new TextAttributesKey [0 ];
27
26
28
27
@ NotNull
@@ -39,13 +38,21 @@ public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
39
38
} else if (tokenType .equals (ExpressionLanguageTypes .STRING )) {
40
39
return STRING_KEYS ;
41
40
} else if (tokenType .equals (ExpressionLanguageTypes .ID )) {
42
- return ID_KEYS ;
43
- } else if (tokenType .equals (ExpressionLanguageTypes .IDENTIFIER )) {
44
41
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 ;
49
54
}
55
+
56
+ return EMPTY_KEYS ;
50
57
}
51
58
}
0 commit comments