@@ -16,7 +16,7 @@ export default class FortranLintingProvider {
16
16
17
17
private diagnosticCollection : vscode . DiagnosticCollection ;
18
18
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; ;
20
20
21
21
if ( textDocument . languageId !== LANGUAGE_ID ) {
22
22
return ;
@@ -28,10 +28,15 @@ export default class FortranLintingProvider {
28
28
let includePaths = this . getIncludePaths ( ) ;
29
29
let command = this . getGfortranPath ( ) ;
30
30
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 )
35
40
36
41
if ( childProcess . pid ) {
37
42
childProcess . stdout . on ( 'data' , ( data : Buffer ) => {
@@ -41,8 +46,6 @@ export default class FortranLintingProvider {
41
46
decoded += data ;
42
47
} ) ;
43
48
childProcess . stderr . on ( 'end' , ( ) => {
44
- let decodedOriginal = decoded ;
45
-
46
49
let matchesArray : string [ ] ;
47
50
while ( ( matchesArray = errorRegex . exec ( decoded ) ) !== null ) {
48
51
let elements : string [ ] = matchesArray . slice ( 1 ) ; // get captured expressions
0 commit comments