IDEA plugin: fixed highlighting for objects.

This commit is contained in:
Zalim Bashorov
2014-07-10 13:12:46 +04:00
parent 2ee818f784
commit 2947963e67
6 changed files with 12 additions and 8 deletions
@@ -149,6 +149,7 @@ options.kotlin.attribute.descriptor.kdoc.comment=KDoc comment
options.kotlin.attribute.descriptor.kdoc.tag=KDoc tag
options.kotlin.attribute.descriptor.kdoc.value=KDoc tag value
options.kotlin.attribute.descriptor.trait=Trait
options.kotlin.attribute.descriptor.object=Object
options.kotlin.attribute.descriptor.annotation=Annotation
options.kotlin.attribute.descriptor.var=Var (mutable variable, parameter or property)
options.kotlin.attribute.descriptor.local.variable=Local variable or value
@@ -134,6 +134,7 @@ public class JetColorSettingsPage implements ColorSettingsPage {
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.abstract.class"), JetHighlightingColors.ABSTRACT_CLASS),
new AttributesDescriptor(JetBundle.message("options.kotlin.attribute.descriptor.trait"), JetHighlightingColors.TRAIT),
new AttributesDescriptor(JetBundle.message("options.kotlin.attribute.descriptor.annotation"), JetHighlightingColors.ANNOTATION),
new AttributesDescriptor(JetBundle.message("options.kotlin.attribute.descriptor.object"), JetHighlightingColors.OBJECT),
new AttributesDescriptor(JetBundle.message("options.kotlin.attribute.descriptor.var"), JetHighlightingColors.MUTABLE_VARIABLE),
@@ -54,6 +54,7 @@ public class JetHighlightingColors {
public static final TextAttributesKey ABSTRACT_CLASS = createTextAttributesKey("KOTLIN_ABSTRACT_CLASS", CodeInsightColors.ABSTRACT_CLASS_NAME_ATTRIBUTES);
public static final TextAttributesKey TRAIT = createTextAttributesKey("KOTLIN_TRAIT", CodeInsightColors.INTERFACE_NAME_ATTRIBUTES);
public static final TextAttributesKey ANNOTATION = createTextAttributesKey("KOTLIN_ANNOTATION", CodeInsightColors.ANNOTATION_NAME_ATTRIBUTES);
public static final TextAttributesKey OBJECT = createTextAttributesKey("KOTLIN_OBJECT", CLASS);
// variable kinds
public static final TextAttributesKey MUTABLE_VARIABLE = createTextAttributesKey("KOTLIN_MUTABLE_VARIABLE");
@@ -93,8 +93,8 @@ class TypeKindHighlightingVisitor extends AfterAnalysisHighlightingVisitor {
case ANNOTATION_CLASS:
return JetHighlightingColors.ANNOTATION;
case OBJECT:
return JetHighlightingColors.OBJECT;
case ENUM_ENTRY:
// Treat object accesses as variables to simulate the old behaviour (when variables were created for objects)
return JetHighlightingColors.INSTANCE_PROPERTY;
default:
return descriptor.getModality() == Modality.ABSTRACT