1
1
package dev .openfga .intellijplugin ;
2
2
3
- import dev . openfga . intellijplugin . parsing . OpenFGATokenSets ;
4
- import dev . openfga . intellijplugin . psi . OpenFGATypes ;
3
+ import static com . intellij . openapi . editor . colors . TextAttributesKey . createTextAttributesKey ;
4
+
5
5
import com .intellij .lexer .Lexer ;
6
6
import com .intellij .openapi .editor .DefaultLanguageHighlighterColors ;
7
7
import com .intellij .openapi .editor .colors .TextAttributesKey ;
8
8
import com .intellij .openapi .fileTypes .SyntaxHighlighterBase ;
9
9
import com .intellij .psi .tree .IElementType ;
10
+ import dev .openfga .intellijplugin .parsing .OpenFGATokenSets ;
11
+ import dev .openfga .intellijplugin .psi .OpenFGATypes ;
10
12
import org .jetbrains .annotations .NotNull ;
11
13
12
- import static com .intellij .openapi .editor .colors .TextAttributesKey .createTextAttributesKey ;
13
-
14
14
public class OpenFGASyntaxHighlighter extends SyntaxHighlighterBase {
15
15
public static final TextAttributesKey KEYWORD =
16
16
createTextAttributesKey ("OPENFGA_KEYWORD" , DefaultLanguageHighlighterColors .KEYWORD );
@@ -30,25 +30,26 @@ public class OpenFGASyntaxHighlighter extends SyntaxHighlighterBase {
30
30
createTextAttributesKey ("OPENFGA_CONDITION_IDENTIFIER" , DefaultLanguageHighlighterColors .CLASS_NAME );
31
31
public static final TextAttributesKey CONDITION_REFERENCE =
32
32
createTextAttributesKey ("OPENFGA_CONDITION_REFERENCE" , DefaultLanguageHighlighterColors .CLASS_REFERENCE );
33
- public static final TextAttributesKey CONDITION_PARAM_IDENTIFIER =
34
- createTextAttributesKey ( "OPENFGA_CONDITION_PARAM_IDENTIFIER" , DefaultLanguageHighlighterColors .INSTANCE_METHOD );
33
+ public static final TextAttributesKey CONDITION_PARAM_IDENTIFIER = createTextAttributesKey (
34
+ "OPENFGA_CONDITION_PARAM_IDENTIFIER" , DefaultLanguageHighlighterColors .INSTANCE_METHOD );
35
35
public static final TextAttributesKey CONDITION_PARAM_TYPE =
36
36
createTextAttributesKey ("OPENFGA_CONDITION_PARAM_TYPE" , DefaultLanguageHighlighterColors .PARAMETER );
37
37
public static final TextAttributesKey COMMENT =
38
38
createTextAttributesKey ("OPENFGA_COMMENTS" , DefaultLanguageHighlighterColors .LINE_COMMENT );
39
39
40
- private static final TextAttributesKey [] KEYWORD_KEYS = new TextAttributesKey []{KEYWORD };
41
- private static final TextAttributesKey [] MODULE_NAME_KEY = new TextAttributesKey []{MODULE_NAME };
42
- private static final TextAttributesKey [] SCHEMA_VERSIONS_KEYS = new TextAttributesKey []{SCHEMA_VERSIONS };
43
- private static final TextAttributesKey [] RELATION_NAME_KEYS = new TextAttributesKey []{RELATION_NAME };
44
- private static final TextAttributesKey [] RELATION_REFERENCE_KEYS = new TextAttributesKey []{RELATION_REFERENCE };
45
- private static final TextAttributesKey [] TYPE_IDENTIFIER_KEYS = new TextAttributesKey []{TYPE_IDENTIFIER };
46
- private static final TextAttributesKey [] TYPE_REFERENCE_KEYS = new TextAttributesKey []{TYPE_REFERENCE };
47
- private static final TextAttributesKey [] CONDITION_IDENTIFIER_KEYS = new TextAttributesKey []{CONDITION_IDENTIFIER };
48
- private static final TextAttributesKey [] CONDITION_REFERENCE_KEYS = new TextAttributesKey []{CONDITION_REFERENCE };
49
- private static final TextAttributesKey [] CONDITION_PARAM_KEYS = new TextAttributesKey []{CONDITION_PARAM_IDENTIFIER };
50
- private static final TextAttributesKey [] CONDITION_PARAM_TYPES = new TextAttributesKey []{CONDITION_PARAM_TYPE };
51
- private static final TextAttributesKey [] COMMENT_KEYS = new TextAttributesKey []{COMMENT };
40
+ private static final TextAttributesKey [] KEYWORD_KEYS = new TextAttributesKey [] {KEYWORD };
41
+ private static final TextAttributesKey [] MODULE_NAME_KEY = new TextAttributesKey [] {MODULE_NAME };
42
+ private static final TextAttributesKey [] SCHEMA_VERSIONS_KEYS = new TextAttributesKey [] {SCHEMA_VERSIONS };
43
+ private static final TextAttributesKey [] RELATION_NAME_KEYS = new TextAttributesKey [] {RELATION_NAME };
44
+ private static final TextAttributesKey [] RELATION_REFERENCE_KEYS = new TextAttributesKey [] {RELATION_REFERENCE };
45
+ private static final TextAttributesKey [] TYPE_IDENTIFIER_KEYS = new TextAttributesKey [] {TYPE_IDENTIFIER };
46
+ private static final TextAttributesKey [] TYPE_REFERENCE_KEYS = new TextAttributesKey [] {TYPE_REFERENCE };
47
+ private static final TextAttributesKey [] CONDITION_IDENTIFIER_KEYS = new TextAttributesKey [] {CONDITION_IDENTIFIER };
48
+ private static final TextAttributesKey [] CONDITION_REFERENCE_KEYS = new TextAttributesKey [] {CONDITION_REFERENCE };
49
+ private static final TextAttributesKey [] CONDITION_PARAM_KEYS =
50
+ new TextAttributesKey [] {CONDITION_PARAM_IDENTIFIER };
51
+ private static final TextAttributesKey [] CONDITION_PARAM_TYPES = new TextAttributesKey [] {CONDITION_PARAM_TYPE };
52
+ private static final TextAttributesKey [] COMMENT_KEYS = new TextAttributesKey [] {COMMENT };
52
53
private static final TextAttributesKey [] EMPTY_KEYS = new TextAttributesKey [0 ];
53
54
54
55
@ NotNull
@@ -110,5 +111,4 @@ public Lexer getHighlightingLexer() {
110
111
111
112
return EMPTY_KEYS ;
112
113
}
113
-
114
- }
114
+ }
0 commit comments