Skip to content

Commit 51359cf

Browse files
committed
Add check name to inspection message (#674)
1 parent 44a4338 commit 51359cf

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/main/java/org/infernus/idea/checkstyle/checker/Problem.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ public record Problem(@NotNull PsiElement target,
2323
@NotNull
2424
public ProblemDescriptor toProblemDescriptor(final InspectionManager inspectionManager,
2525
final boolean onTheFly) {
26+
String sourceCheck = DisplayFormats.shortenClassName(sourceName);
2627
return inspectionManager.createProblemDescriptor(target,
27-
CheckStyleBundle.message("inspection.message", message()),
28-
quickFixes(), problemHighlightType(), onTheFly, afterEndOfLine);
28+
CheckStyleBundle.message("inspection.message", message, sourceCheck),
29+
quickFixes(sourceCheck), problemHighlightType(), onTheFly, afterEndOfLine);
2930
}
3031

31-
private LocalQuickFix[] quickFixes() {
32-
if (sourceName != null) {
33-
return new LocalQuickFix[]{new SuppressForCheckstyleFix(DisplayFormats.shortenClassName(sourceName))};
32+
private LocalQuickFix[] quickFixes(final String sourceCheck) {
33+
if (sourceCheck != null) {
34+
return new LocalQuickFix[]{new SuppressForCheckstyleFix(sourceCheck)};
3435
}
3536
return null;
3637
}

src/main/resources/org/infernus/idea/checkstyle/CheckStyleBundle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ plugin.exception.parse=The source file could not be parsed by Checkstyle
5454

5555
inspection.group=Checkstyle
5656
inspection.display-name=Checkstyle real-time scan
57-
inspection.message=Checkstyle: {0}
57+
inspection.message=Checkstyle: {0} [{1}]
5858

5959
inspection.fix.suppress-for-checkstyle=Suppress for Checkstyle
6060

0 commit comments

Comments
 (0)