Skip to content

Commit c425b00

Browse files
committed
Больше типов токенов для хайлатера
1 parent 5856b93 commit c425b00

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

intellij-bsl/src/main/java/org/github/_1c_syntax/intellij/bsl/BSLSyntaxHighlighter.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,24 @@ public class BSLSyntaxHighlighter extends SyntaxHighlighterBase {
5252
private static final TextAttributesKey DATETIME =
5353
TextAttributesKey.createTextAttributesKey("BSL_DATETIME", DefaultLanguageHighlighterColors.STRING);
5454

55+
private static final TextAttributesKey NUMBER =
56+
TextAttributesKey.createTextAttributesKey("BSL_NUMBER", DefaultLanguageHighlighterColors.NUMBER);
57+
58+
private static final TextAttributesKey DOT =
59+
TextAttributesKey.createTextAttributesKey("BSL_DOT", DefaultLanguageHighlighterColors.DOT);
60+
61+
private static final TextAttributesKey SEMICOLON =
62+
TextAttributesKey.createTextAttributesKey("BSL_SEMICOLON", DefaultLanguageHighlighterColors.SEMICOLON);
63+
64+
private static final TextAttributesKey COMMA =
65+
TextAttributesKey.createTextAttributesKey("BSL_COMMA", DefaultLanguageHighlighterColors.COMMA);
66+
67+
private static final TextAttributesKey PARENTHESES =
68+
TextAttributesKey.createTextAttributesKey("BSL_PARENTHESES", DefaultLanguageHighlighterColors.PARENTHESES);
69+
70+
private static final TextAttributesKey BRACKETS =
71+
TextAttributesKey.createTextAttributesKey("BSL_BRACKETS", DefaultLanguageHighlighterColors.BRACKETS);
72+
5573
private static final TextAttributesKey LITERAL_CONSTANT =
5674
TextAttributesKey.createTextAttributesKey("BSL_LITERAL_CONSTANT", DefaultLanguageHighlighterColors.CONSTANT);
5775

@@ -124,6 +142,10 @@ public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
124142
case BSLLexer.NULL:
125143
attrKey = LITERAL_CONSTANT;
126144
break;
145+
case BSLLexer.DECIMAL:
146+
case BSLLexer.FLOAT:
147+
attrKey = NUMBER;
148+
break;
127149
case BSLLexer.STRING:
128150
case BSLLexer.STRINGSTART:
129151
case BSLLexer.STRINGPART:
@@ -160,6 +182,23 @@ public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
160182
case BSLLexer.ANNOTATION_CUSTOM_SYMBOL:
161183
attrKey = ANNOTATIONS;
162184
break;
185+
case BSLLexer.DOT:
186+
attrKey = DOT;
187+
break;
188+
case BSLLexer.SEMICOLON:
189+
attrKey = SEMICOLON;
190+
break;
191+
case BSLLexer.COMMA:
192+
attrKey = COMMA;
193+
break;
194+
case BSLLexer.LPAREN:
195+
case BSLLexer.RPAREN:
196+
attrKey = PARENTHESES;
197+
break;
198+
case BSLLexer.LBRACK:
199+
case BSLLexer.RBRACK:
200+
attrKey = BRACKETS;
201+
break;
163202
default:
164203
return EMPTY_KEYS;
165204
}

0 commit comments

Comments
 (0)