mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
GitOrigin-RevId: 02dab52978eac8944bc6e5987eeff61dbd03e717
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8cfdfff2d9
commit
1d938443d9
@@ -342,11 +342,9 @@ public abstract class DaemonAnalyzerTestCase extends JavaCodeInsightTestCase {
|
||||
IntentionAction intentionAction = LightQuickFixTestCase.findActionWithText(actions, intentionActionName);
|
||||
|
||||
if (intentionAction == null) {
|
||||
fail(String.format("Could not find action by name %s.\n" +
|
||||
"Actions: [%s]\n" +
|
||||
"HighlightInfos: [%s]", intentionActionName,
|
||||
StringUtil.join(ContainerUtil.map(actions, c -> c.getText()), ", "),
|
||||
StringUtil.join(infos, ", ")));
|
||||
fail("Could not find action '" + intentionActionName+
|
||||
"'.\nAvailable actions: [" +StringUtil.join(ContainerUtil.map(actions, c -> c.getText()), ", ")+ "]\n" +
|
||||
"HighlightInfos: [" +StringUtil.join(infos, ", ")+"]");
|
||||
}
|
||||
CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor, intentionActionName);
|
||||
}
|
||||
|
||||
@@ -246,26 +246,24 @@ public final class Annotation implements Segment {
|
||||
public TextAttributesKey getTextAttributes() {
|
||||
if (myEnforcedAttributesKey != null) return myEnforcedAttributesKey;
|
||||
|
||||
if (myHighlightType == ProblemHighlightType.GENERIC_ERROR_OR_WARNING) {
|
||||
if (mySeverity == HighlightSeverity.ERROR) return CodeInsightColors.ERRORS_ATTRIBUTES;
|
||||
if (mySeverity == HighlightSeverity.WARNING) return CodeInsightColors.WARNINGS_ATTRIBUTES;
|
||||
if (mySeverity == HighlightSeverity.WEAK_WARNING) return CodeInsightColors.WEAK_WARNING_ATTRIBUTES;
|
||||
switch (myHighlightType) {
|
||||
case GENERIC_ERROR_OR_WARNING:
|
||||
if (mySeverity == HighlightSeverity.ERROR) return CodeInsightColors.ERRORS_ATTRIBUTES;
|
||||
if (mySeverity == HighlightSeverity.WARNING) return CodeInsightColors.WARNINGS_ATTRIBUTES;
|
||||
if (mySeverity == HighlightSeverity.WEAK_WARNING) return CodeInsightColors.WEAK_WARNING_ATTRIBUTES;
|
||||
return HighlighterColors.NO_HIGHLIGHTING;
|
||||
case GENERIC_ERROR:
|
||||
return CodeInsightColors.ERRORS_ATTRIBUTES;
|
||||
case LIKE_DEPRECATED:
|
||||
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
|
||||
case LIKE_UNUSED_SYMBOL:
|
||||
return CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES;
|
||||
case LIKE_UNKNOWN_SYMBOL:
|
||||
case ERROR:
|
||||
return CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES;
|
||||
default:
|
||||
return HighlighterColors.NO_HIGHLIGHTING;
|
||||
}
|
||||
|
||||
if (myHighlightType == ProblemHighlightType.GENERIC_ERROR) {
|
||||
return CodeInsightColors.ERRORS_ATTRIBUTES;
|
||||
}
|
||||
|
||||
if (myHighlightType == ProblemHighlightType.LIKE_DEPRECATED) {
|
||||
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
|
||||
}
|
||||
if (myHighlightType == ProblemHighlightType.LIKE_UNUSED_SYMBOL) {
|
||||
return CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES;
|
||||
}
|
||||
if (myHighlightType == ProblemHighlightType.LIKE_UNKNOWN_SYMBOL || myHighlightType == ProblemHighlightType.ERROR) {
|
||||
return CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES;
|
||||
}
|
||||
return HighlighterColors.NO_HIGHLIGHTING;
|
||||
}
|
||||
|
||||
public TextAttributes getEnforcedTextAttributes() {
|
||||
|
||||
@@ -691,16 +691,22 @@ public class HighlightInfo implements Segment {
|
||||
@NotNull
|
||||
private static HighlightInfoType convertType(@NotNull Annotation annotation) {
|
||||
ProblemHighlightType type = annotation.getHighlightType();
|
||||
if (type == ProblemHighlightType.LIKE_UNUSED_SYMBOL) return HighlightInfoType.UNUSED_SYMBOL;
|
||||
if (type == ProblemHighlightType.LIKE_UNKNOWN_SYMBOL) return HighlightInfoType.WRONG_REF;
|
||||
if (type == ProblemHighlightType.LIKE_DEPRECATED) return HighlightInfoType.DEPRECATED;
|
||||
if (type == ProblemHighlightType.LIKE_MARKED_FOR_REMOVAL) return HighlightInfoType.MARKED_FOR_REMOVAL;
|
||||
return convertSeverity(annotation.getSeverity());
|
||||
HighlightSeverity severity = annotation.getSeverity();
|
||||
return toHighlightInfoType(type, severity);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static HighlightInfoType toHighlightInfoType(ProblemHighlightType problemHighlightType, @NotNull HighlightSeverity severity) {
|
||||
if (problemHighlightType == ProblemHighlightType.LIKE_UNUSED_SYMBOL) return HighlightInfoType.UNUSED_SYMBOL;
|
||||
if (problemHighlightType == ProblemHighlightType.LIKE_UNKNOWN_SYMBOL) return HighlightInfoType.WRONG_REF;
|
||||
if (problemHighlightType == ProblemHighlightType.LIKE_DEPRECATED) return HighlightInfoType.DEPRECATED;
|
||||
if (problemHighlightType == ProblemHighlightType.LIKE_MARKED_FOR_REMOVAL) return HighlightInfoType.MARKED_FOR_REMOVAL;
|
||||
return convertSeverity(severity);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@SuppressWarnings("deprecation")
|
||||
public static HighlightInfoType convertSeverity(@NotNull HighlightSeverity severity) {
|
||||
//noinspection deprecation
|
||||
return severity == HighlightSeverity.ERROR? HighlightInfoType.ERROR :
|
||||
severity == HighlightSeverity.WARNING ? HighlightInfoType.WARNING :
|
||||
severity == HighlightSeverity.INFO ? HighlightInfoType.INFO :
|
||||
@@ -710,7 +716,7 @@ public class HighlightInfo implements Segment {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ProblemHighlightType convertType(HighlightInfoType infoType) {
|
||||
public static ProblemHighlightType convertType(@NotNull HighlightInfoType infoType) {
|
||||
if (infoType == HighlightInfoType.ERROR || infoType == HighlightInfoType.WRONG_REF) return ProblemHighlightType.ERROR;
|
||||
if (infoType == HighlightInfoType.WARNING) return ProblemHighlightType.WARNING;
|
||||
if (infoType == HighlightInfoType.INFORMATION) return ProblemHighlightType.INFORMATION;
|
||||
@@ -718,8 +724,8 @@ public class HighlightInfo implements Segment {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@SuppressWarnings("deprecation")
|
||||
public static ProblemHighlightType convertSeverityToProblemHighlight(HighlightSeverity severity) {
|
||||
public static ProblemHighlightType convertSeverityToProblemHighlight(@NotNull HighlightSeverity severity) {
|
||||
//noinspection deprecation
|
||||
return severity == HighlightSeverity.ERROR ? ProblemHighlightType.ERROR :
|
||||
severity == HighlightSeverity.WARNING ? ProblemHighlightType.WARNING :
|
||||
severity == HighlightSeverity.INFO ? ProblemHighlightType.INFO :
|
||||
|
||||
Reference in New Issue
Block a user