Correct JavaDoc attributes (IDEA-100249 Darcula: default attributes for Javadoc)

This commit is contained in:
Rustam Vishnyakov
2015-02-19 19:22:04 +03:00
parent 8ba0891010
commit 78ce165a03
6 changed files with 10 additions and 32 deletions
@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl;
import com.intellij.ide.highlighter.JavaHighlightingColors;
import com.intellij.lang.annotation.Annotation;
import com.intellij.lang.annotation.AnnotationHolder;
import com.intellij.lang.annotation.Annotator;
@@ -37,7 +38,7 @@ public class JavaDocAnnotator implements Annotator {
PsiDocTagValue tagValue = ((PsiDocTag)element).getValueElement();
if (tagValue != null) {
Annotation annotation = holder.createInfoAnnotation(tagValue, null);
annotation.setTextAttributes(CodeInsightColors.DOC_COMMENT_TAG_VALUE);
annotation.setTextAttributes(JavaHighlightingColors.DOC_COMMENT_TAG_VALUE);
}
}
}
@@ -15,6 +15,7 @@
*/
package com.intellij.ide.highlighter;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.SyntaxHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
@@ -40,6 +41,9 @@ public class JavaHighlightingColors {
public static final TextAttributesKey JAVA_SEMICOLON = SyntaxHighlighterColors.JAVA_SEMICOLON;
public static final TextAttributesKey DOC_COMMENT_TAG = SyntaxHighlighterColors.DOC_COMMENT_TAG;
public static final TextAttributesKey DOC_COMMENT_MARKUP = SyntaxHighlighterColors.DOC_COMMENT_MARKUP;
public static final TextAttributesKey DOC_COMMENT_TAG_VALUE = TextAttributesKey.createTextAttributesKey(
"DOC_COMMENT_TAG_VALUE",
DefaultLanguageHighlighterColors.DOC_COMMENT_TAG_VALUE);
public static final TextAttributesKey VALID_STRING_ESCAPE = SyntaxHighlighterColors.VALID_STRING_ESCAPE;
public static final TextAttributesKey INVALID_STRING_ESCAPE = SyntaxHighlighterColors.INVALID_STRING_ESCAPE;
@@ -57,7 +57,7 @@ public class JavaColorSettingsPage implements ColorSettingsPage, InspectionColor
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.block.comment"), JavaHighlightingColors.JAVA_BLOCK_COMMENT),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.javadoc.comment"), JavaHighlightingColors.DOC_COMMENT),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.javadoc.tag"), JavaHighlightingColors.DOC_COMMENT_TAG),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.javadoc.tag.value"), CodeInsightColors.DOC_COMMENT_TAG_VALUE),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.javadoc.tag.value"), JavaHighlightingColors.DOC_COMMENT_TAG_VALUE),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.javadoc.markup"), JavaHighlightingColors.DOC_COMMENT_MARKUP),
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.class"), CodeInsightColors.CLASS_NAME_ATTRIBUTES),
@@ -119,7 +119,7 @@ public class JavaColorSettingsPage implements ColorSettingsPage, InspectionColor
ourTags.put("enum", CodeInsightColors.ENUM_NAME_ATTRIBUTES);
ourTags.put("annotationName", CodeInsightColors.ANNOTATION_NAME_ATTRIBUTES);
ourTags.put("annotationAttributeName", CodeInsightColors.ANNOTATION_ATTRIBUTE_NAME_ATTRIBUTES);
ourTags.put("javadocTagValue", CodeInsightColors.DOC_COMMENT_TAG_VALUE);
ourTags.put("javadocTagValue", JavaHighlightingColors.DOC_COMMENT_TAG_VALUE);
}
@Override
@@ -24,6 +24,7 @@ import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInspection.DefaultHighlightVisitorBasedInspection;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.ide.highlighter.JavaHighlightingColors;
import com.intellij.lang.Language;
import com.intellij.lang.LanguageAnnotators;
import com.intellij.lang.annotation.Annotation;
@@ -71,7 +72,7 @@ public class FixAllAnnotatorQuickfixTest extends LightQuickFixTestCase {
if (element instanceof PsiMethod) {
Annotation annotation = holder.createErrorAnnotation(((PsiMethod)element).getNameIdentifier(), null);
annotation.registerUniversalFix(new MyFix(), null, null);
annotation.setTextAttributes(CodeInsightColors.DOC_COMMENT_TAG_VALUE);
annotation.setTextAttributes(JavaHighlightingColors.DOC_COMMENT_TAG_VALUE);
}
}