use of com.intellij.lang.annotation.HighlightSeverity in project android by JetBrains.
the class AndroidLintExternalAnnotator method createAnnotation.
@SuppressWarnings("deprecation")
@NotNull
private Annotation createAnnotation(@NotNull AnnotationHolder holder, @NotNull String message, @NotNull TextRange range, @NotNull HighlightDisplayLevel displayLevel, @NotNull Issue issue) {
// Convert from inspection severity to annotation severity
HighlightSeverity severity;
if (displayLevel == HighlightDisplayLevel.ERROR) {
severity = HighlightSeverity.ERROR;
} else if (displayLevel == HighlightDisplayLevel.WARNING) {
severity = HighlightSeverity.WARNING;
} else if (displayLevel == HighlightDisplayLevel.WEAK_WARNING) {
severity = HighlightSeverity.WEAK_WARNING;
} else if (displayLevel == HighlightDisplayLevel.INFO) {
severity = HighlightSeverity.INFO;
} else {
severity = HighlightSeverity.WARNING;
}
String link = " <a " + "href=\"#lint/" + issue.getId() + "\"" + (UIUtil.isUnderDarcula() ? " color=\"7AB4C9\" " : "") + ">" + DaemonBundle.message("inspection.extended.description") + "</a> " + getShowMoreShortCut();
String tooltip = XmlStringUtil.wrapInHtml(RAW.convertTo(message, HTML) + link);
return holder.createAnnotation(severity, range, message, tooltip);
}
Aggregations