@@ -16,7 +16,7 @@ export default class FortranLintingProvider {
1616
1717 private diagnosticCollection : vscode . DiagnosticCollection ;
1818 private doModernFortranLint ( textDocument : vscode . TextDocument ) {
19- const errorRegex : RegExp = / ^ ( [ ^ : ] * ) : ( [ 0 - 9 ] + ) : ( [ 0 - 9 ] + ) : \n \s ( .* ) \n .* \n ( E r r o r | W a r n i n g | F a t a l E r r o r ) : \s ( .* ) $ / gm;
19+ const errorRegex : RegExp = / ^ . { 2 } ( [ ^ : ] * ) : ( [ 0 - 9 ] + ) : ( [ 0 - 9 ] + ) : \r ? \ n\s * ( .* ) \r ? \ n .* \r ? \ n( E r r o r | W a r n i n g | F a t a l E r r o r ) : \s ( .* ) $ / gm; ;
2020
2121 if ( textDocument . languageId !== LANGUAGE_ID ) {
2222 return ;
@@ -28,10 +28,15 @@ export default class FortranLintingProvider {
2828 let includePaths = this . getIncludePaths ( ) ;
2929 let command = this . getGfortranPath ( ) ;
3030
31- let childProcess = cp . spawn ( command , [
32- ...args ,
33- getIncludeParams ( includePaths ) , // include paths
34- textDocument . fileName ] ) ;
31+ let argList = [
32+ ...args ,
33+ getIncludeParams ( includePaths ) , // include paths
34+ textDocument . fileName
35+ ] ;
36+
37+ argList = argList . map ( arg => arg . trim ( ) ) . filter ( arg => arg !== "" ) ;
38+
39+ let childProcess = cp . spawn ( command , argList )
3540
3641 if ( childProcess . pid ) {
3742 childProcess . stdout . on ( 'data' , ( data : Buffer ) => {
@@ -41,8 +46,6 @@ export default class FortranLintingProvider {
4146 decoded += data ;
4247 } ) ;
4348 childProcess . stderr . on ( 'end' , ( ) => {
44- let decodedOriginal = decoded ;
45-
4649 let matchesArray : string [ ] ;
4750 while ( ( matchesArray = errorRegex . exec ( decoded ) ) !== null ) {
4851 let elements : string [ ] = matchesArray . slice ( 1 ) ; // get captured expressions
0 commit comments