@@ -25,15 +25,12 @@ export default class FortranLintingProvider {
25
25
let decoded = '' ;
26
26
let diagnostics : vscode . Diagnostic [ ] = [ ] ;
27
27
let options = vscode . workspace . rootPath ? { cwd : vscode . workspace . rootPath } : undefined ;
28
- let args = [ '' , textDocument . fileName ] ;
28
+ let args = [ ... this . getLinterExtraArgs ( ) , "-cpp" , "-fsyntax-only" , '-fdiagnostics-show-option' ] ;
29
29
let includePaths = this . getIncludePaths ( ) ;
30
30
let command = this . getGfortranPath ( ) ;
31
31
32
32
let childProcess = cp . spawn ( command , [
33
- '-cpp' ,
34
- '-fsyntax-only' ,
35
- '-Wall' ,
36
- '-fdiagnostics-show-option' ,
33
+ ...args ,
37
34
getIncludeParams ( includePaths ) , // include paths
38
35
textDocument . fileName ] ) ;
39
36
@@ -79,12 +76,13 @@ export default class FortranLintingProvider {
79
76
private static commandId : string = 'fortran.lint.runCodeAction' ;
80
77
81
78
public provideCodeActions ( document : vscode . TextDocument , range : vscode . Range , context : vscode . CodeActionContext , token : vscode . CancellationToken ) : vscode . Command [ ] {
82
- let diagnostic : vscode . Diagnostic = context . diagnostics [ 0 ] ;
83
- return [ {
84
- title : "Accept gfortran suggestion" ,
85
- command : FortranLintingProvider . commandId ,
86
- arguments : [ document , diagnostic . range , diagnostic . message ]
87
- } ] ;
79
+ return ;
80
+ // let diagnostic: vscode.Diagnostic = context.diagnostics[0];
81
+ // return [{
82
+ // title: "Accept gfortran suggestion",
83
+ // command: FortranLintingProvider.commandId,
84
+ // arguments: [document, diagnostic.range, diagnostic.message]
85
+ // }];
88
86
}
89
87
90
88
private command : vscode . Disposable ;
@@ -122,5 +120,9 @@ export default class FortranLintingProvider {
122
120
let config = vscode . workspace . getConfiguration ( 'fortran' ) ;
123
121
return config . get ( "gfortranExecutable" , "gfortran" ) ;
124
122
}
123
+ private getLinterExtraArgs ( ) :string [ ] {
124
+ let config = vscode . workspace . getConfiguration ( 'fortran' ) ;
125
+ return config . get ( "linterExtraArgs" , [ "-Wall" ] ) ;
126
+ }
125
127
126
128
}
0 commit comments