Skip to content

Commit

Permalink
failed test line highlighting: warning by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-avdeev committed May 14, 2018
1 parent d898da8 commit 6fb72d0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public void visitMethodCallExpression(PsiMethodCallExpression call) {
new RunActionFix(call, DefaultRunExecutor.EXECUTOR_ID)};
ProblemDescriptor descriptor = InspectionManager.getInstance(call.getProject())
.createProblemDescriptor(call, state.errorMessage, isOnTheFly, fixes,
ProblemHighlightType.GENERIC_ERROR);
descriptor.setTextAttributes(CodeInsightColors.RUNTIME_PROBLEM);
ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
descriptor.setTextAttributes(CodeInsightColors.RUNTIME_ERROR);
holder.registerProblem(descriptor);
}
};
Expand Down
2 changes: 1 addition & 1 deletion java/java-impl/src/META-INF/JavaPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
implementationClass="com.intellij.testIntegration.TestRunLineMarkerProvider"/>
<projectService serviceImplementation="com.intellij.testIntegration.TestFailedLineManager"/>
<localInspection groupPath="Java" language="JAVA" shortName="TestFailedLine"
enabledByDefault="true" level="ERROR"
enabledByDefault="true" level="WARNING"
groupBundle="messages.InspectionsBundle" groupKey="group.names.junit.issues"
displayName="Highlight problem line in test"
implementationClass="com.intellij.execution.testframework.TestFailedLineInspection"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface CodeInsightColors {
TextAttributesKey WARNINGS_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("WARNING_ATTRIBUTES");
TextAttributesKey GENERIC_SERVER_ERROR_OR_WARNING = TextAttributesKey.createTextAttributesKey("GENERIC_SERVER_ERROR_OR_WARNING");
TextAttributesKey DUPLICATE_FROM_SERVER = TextAttributesKey.createTextAttributesKey("DUPLICATE_FROM_SERVER");
TextAttributesKey RUNTIME_PROBLEM = TextAttributesKey.createTextAttributesKey("RUNTIME_PROBLEM");
TextAttributesKey RUNTIME_ERROR = TextAttributesKey.createTextAttributesKey("RUNTIME_ERROR");
/**
* use #WEAK_WARNING_ATTRIBUTES instead
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static void addInspectionSeverityAttributes(List<AttributesDescriptor> d
descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.weak.warning"), CodeInsightColors.WEAK_WARNING_ATTRIBUTES));
descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.problems"), CodeInsightColors.GENERIC_SERVER_ERROR_OR_WARNING));
descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.duplicate"), CodeInsightColors.DUPLICATE_FROM_SERVER));
descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.runtime"), CodeInsightColors.RUNTIME_PROBLEM));
descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.runtime"), CodeInsightColors.RUNTIME_ERROR));

for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) {
for (HighlightInfoType highlightInfoType : provider.getSeveritiesHighlightInfoTypes()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public class GeneralColorsPage implements ColorSettingsPage, InspectionColorSett
" <for_removal>Deprecated symbol marked for removal</for_removal>\n" +
" <unused>Unused symbol</unused>\n"+
" <wrong_ref>Unknown symbol</wrong_ref>\n" +
" <runtime_error>Runtime problem</runtime_error>\n" +
" <server_error>Problem from server</server_error>\n" +
" <server_duplicate>Duplicate from server</server_duplicate>\n" +
getCustomSeveritiesDemoText();
Expand Down Expand Up @@ -168,6 +169,7 @@ public class GeneralColorsPage implements ColorSettingsPage, InspectionColorSett
ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("weak_warning", CodeInsightColors.WEAK_WARNING_ATTRIBUTES);
ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("server_error", CodeInsightColors.GENERIC_SERVER_ERROR_OR_WARNING);
ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("server_duplicate", CodeInsightColors.DUPLICATE_FROM_SERVER);
ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put("runtime_error", CodeInsightColors.RUNTIME_ERROR);
for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) {
for (HighlightInfoType highlightInfoType : provider.getSeveritiesHighlightInfoTypes()) {
ADDITIONAL_HIGHLIGHT_DESCRIPTORS.put(getHighlightDescTagName(highlightInfoType),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@
<option name="ERROR_STRIPE_COLOR" value="cf5b56" deuteranopia="d95716" protanopia="d95716"/>
</value>
</option>
<option name="RUNTIME_PROBLEM">
<option name="RUNTIME_ERROR">
<value>
<option name="EFFECT_COLOR" value="ff0000" />
<option name="EFFECT_COLOR" value="f49810" />
<option name="ERROR_STRIPE_COLOR" value="cf5b56" />
<option name="EFFECT_TYPE" value="5" />
</value>
Expand Down Expand Up @@ -1600,9 +1600,9 @@
<option name="ERROR_STRIPE_COLOR" value="9e2927" deuteranopia="ff8f40" protanopia="ff8f40"/>
</value>
</option>
<option name="RUNTIME_PROBLEM">
<option name="RUNTIME_ERROR">
<value>
<option name="EFFECT_COLOR" value="bc3f3c"/>
<option name="EFFECT_COLOR" value="f49810"/>
<option name="EFFECT_TYPE" value="5" />
<option name="ERROR_STRIPE_COLOR" value="9e2927"/>
</value>
Expand Down

0 comments on commit 6fb72d0

Please sign in to comment.