7
7
import com .intellij .execution .configurations .GeneralCommandLine ;
8
8
import com .intellij .execution .process .CapturingProcessHandler ;
9
9
import com .intellij .execution .process .ProcessOutput ;
10
- import com .intellij .notification .Notification ;
11
10
import com .intellij .notification .NotificationType ;
12
- import com .intellij .notification .Notifications ;
13
11
import com .intellij .openapi .editor .Document ;
14
12
import com .intellij .openapi .progress .EmptyProgressIndicator ;
15
13
import com .intellij .openapi .progress .ProcessCanceledException ;
@@ -69,10 +67,9 @@ public static List<ProblemDescriptor> parseOutput(@NotNull final PsiFile psiFile
69
67
70
68
if (VERBOSE_LOG ) {
71
69
// TODO: provide XML output via a "Show Cppcheck output" action - event log messages are truncated
72
- Notifications .Bus .notify (new Notification ("Cppcheck" ,
73
- "Cppcheck execution output for " + psiFile .getName (),
70
+ CppcheckNotification .send ("execution output for " + psiFile .getVirtualFile ().getCanonicalPath (),
74
71
cppcheckOutput ,
75
- NotificationType .INFORMATION )) ;
72
+ NotificationType .INFORMATION );
76
73
}
77
74
78
75
final List <ProblemDescriptor > descriptors = new ArrayList <>();
@@ -119,6 +116,16 @@ public static List<ProblemDescriptor> parseOutput(@NotNull final PsiFile psiFile
119
116
continue ;
120
117
}
121
118
119
+ // suppress this warnings for now - will be properly handled in an upcoming patch
120
+ if (id .equals ("noValidConfiguration" ) || id .equals ("missingInclude" )) {
121
+ continue ;
122
+ }
123
+
124
+ // we are never interested in these
125
+ if (id .equals ("unmatchedSuppression" ) || id .equals ("purgedConfiguration" )) {
126
+ continue ;
127
+ }
128
+
122
129
// suppress this warning for headers until Cppcheck handles them in a better way
123
130
if (SupportedExtensions .isHeaderFile (psiFile .getVirtualFile ()) && id .equals ("unusedStructMember" )) {
124
131
continue ;
@@ -143,6 +150,9 @@ public static List<ProblemDescriptor> parseOutput(@NotNull final PsiFile psiFile
143
150
144
151
// ignore entries without location e.g. missingIncludeSystem
145
152
if (location == null ) {
153
+ CppcheckNotification .send ("no location for " + psiFile .getVirtualFile ().getCanonicalPath (),
154
+ id + " " + severity + " " + inconclusive + " " + errorMessage ,
155
+ NotificationType .ERROR );
146
156
continue ;
147
157
}
148
158
@@ -160,10 +170,9 @@ public static List<ProblemDescriptor> parseOutput(@NotNull final PsiFile psiFile
160
170
161
171
// Cppcheck error
162
172
if (lineNumber <= 0 || lineNumber > document .getLineCount ()) {
163
- Notifications .Bus .notify (new Notification ("Cppcheck" ,
164
- "Cppcheck line number out-of-bounds " + i ,
173
+ CppcheckNotification .send ("line number out-of-bounds for " + psiFile .getVirtualFile ().getCanonicalPath (),
165
174
id + " " + severity + " " + inconclusive + " " + errorMessage + " " + fileName + " " + lineNumber + " " + column ,
166
- NotificationType .ERROR )) ;
175
+ NotificationType .ERROR );
167
176
continue ;
168
177
}
169
178
0 commit comments