File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,23 @@ enum SeverityNumber {
1010 Error = 2
1111}
1212
13+ const criticalWarningTypes = [
14+ 'cppcheckError' ,
15+ 'cppcheckLimit' ,
16+ 'includeNestedTooDeeply' ,
17+ 'internalAstError' ,
18+ 'instantiationError' ,
19+ 'internalError' ,
20+ 'missingFile' ,
21+ 'premium-internalError' ,
22+ 'premium-invalidArgument' ,
23+ 'premium-invalidLicense' ,
24+ 'preprocessorErrorDirective' ,
25+ 'syntaxError' ,
26+ 'unhandledChar' ,
27+ 'unknownMacro'
28+ ] ;
29+
1330function parseSeverity ( str : string ) : vscode . DiagnosticSeverity {
1431 const lower = str . toLowerCase ( ) ;
1532 if ( lower . includes ( "error" ) ) {
@@ -257,9 +274,9 @@ async function runCppcheckOnFileXML(
257274 }
258275
259276 const mainLoc = locations [ locations . length - 1 ] . $ ;
260-
261- // If main location is not current file, then skip displaying warning
262- if ( ! filePath . endsWith ( mainLoc . file ) ) {
277+ console . log ( 'error id ' , e . $ . id , 'error' , e ) ;
278+ // If main location is not current file, then skip displaying warning unless it is critical
279+ if ( ! filePath . endsWith ( mainLoc . file ) && ! criticalWarningTypes . includes ( e . $ . id ) ) {
263280 continue ;
264281 }
265282
You can’t perform that action at this time.
0 commit comments