KT-13378 Provide ability to configure highlighting for !! in expressions and ? in types

This commit is contained in:
Toshiaki Kameyama
2017-10-30 15:14:34 +09:00
committed by Dmitry Jemerov
parent ab619c5655
commit 270b41dc66
7 changed files with 19 additions and 1 deletions
@@ -64,6 +64,8 @@ options.kotlin.attribute.descriptor.builtin.annotation=Modifier
options.kotlin.attribute.descriptor.string.escape=String//Escape in string and template braces
options.kotlin.attribute.descriptor.closure.braces=Braces and Operators//Lambda expression braces and arrow
options.kotlin.attribute.descriptor.safe.access=Braces and Operators//Safe access dot
options.kotlin.attribute.descriptor.quest=Braces and Operators//Question after the type
options.kotlin.attribute.descriptor.exclexcl=Braces and Operators//Non-null assertion
options.kotlin.attribute.descriptor.arrow=Braces and Operators//Arrow
options.kotlin.attribute.descriptor.colon=Braces and Operators//Colon
options.kotlin.attribute.descriptor.double.colon=Braces and Operators//Double colon
@@ -47,6 +47,7 @@ internal class BeforeResolveHighlightingVisitor(holder: AnnotationHolder) : High
}
}
elementType == KtTokens.SAFE_ACCESS -> KotlinHighlightingColors.SAFE_ACCESS
elementType == KtTokens.EXCLEXCL -> KotlinHighlightingColors.EXCLEXCL
else -> return
}
@@ -72,6 +72,7 @@ public class KotlinHighlighter extends SyntaxHighlighterBase {
keys1.put(KtTokens.SEMICOLON, KotlinHighlightingColors.SEMICOLON);
keys1.put(KtTokens.COLON, KotlinHighlightingColors.COLON);
keys1.put(KtTokens.COLONCOLON, KotlinHighlightingColors.DOUBLE_COLON);
keys1.put(KtTokens.QUEST, KotlinHighlightingColors.QUEST);
keys1.put(KtTokens.DOT, KotlinHighlightingColors.DOT);
keys1.put(KtTokens.ARROW, KotlinHighlightingColors.ARROW);
@@ -42,6 +42,8 @@ public class KotlinHighlightingColors {
public static final TextAttributesKey DOUBLE_COLON = createTextAttributesKey("KOTLIN_DOUBLE_COLON");
public static final TextAttributesKey DOT = createTextAttributesKey("KOTLIN_DOT", DefaultLanguageHighlighterColors.DOT);
public static final TextAttributesKey SAFE_ACCESS = createTextAttributesKey("KOTLIN_SAFE_ACCESS", DefaultLanguageHighlighterColors.DOT);
public static final TextAttributesKey QUEST = createTextAttributesKey("KOTLIN_QUEST");
public static final TextAttributesKey EXCLEXCL = createTextAttributesKey("KOTLIN_EXCLEXCL");
public static final TextAttributesKey ARROW = createTextAttributesKey("KOTLIN_ARROW", PARENTHESIS);
public static final TextAttributesKey LINE_COMMENT = createTextAttributesKey("KOTLIN_LINE_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT);
public static final TextAttributesKey BLOCK_COMMENT = createTextAttributesKey("KOTLIN_BLOCK_COMMENT", DefaultLanguageHighlighterColors.BLOCK_COMMENT);