File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
14
14
- Fixes linting regex to capture a wider spectrum of errors
15
15
([ #295 ] ( https://github.com/krvajal/vscode-fortran-support/issues/295 ) )
16
+ - Fixes linter activation from ` Disabled ` to some compiler ` X ` without having
17
+ to restart the extension
18
+ ([ #296 ] ( https://github.com/krvajal/vscode-fortran-support/issues/296 ) )
16
19
17
20
### Changed
18
21
Original file line number Diff line number Diff line change @@ -34,11 +34,10 @@ export async function activate(context: vscode.ExtensionContext) {
34
34
loggingService . logInfo ( `Hover set to: ${ hoverType } ` ) ;
35
35
loggingService . logInfo ( `Symbols set to: ${ symbolsType } ` ) ;
36
36
37
- if ( linterType !== 'Disabled' ) {
38
- const linter = new FortranLintingProvider ( loggingService ) ;
39
- linter . activate ( context . subscriptions ) ;
40
- vscode . languages . registerCodeActionsProvider ( FortranDocumentSelector ( ) , linter ) ;
41
- }
37
+ // Linter is always activated but will only lint if compiler !== Disabled
38
+ const linter = new FortranLintingProvider ( loggingService ) ;
39
+ linter . activate ( context . subscriptions ) ;
40
+ vscode . languages . registerCodeActionsProvider ( FortranDocumentSelector ( ) , linter ) ;
42
41
43
42
if ( formatterType !== 'Disabled' ) {
44
43
const disposable : vscode . Disposable = vscode . languages . registerDocumentFormattingEditProvider (
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ export class FortranLintingProvider {
52
52
}
53
53
54
54
private doModernFortranLint ( textDocument : vscode . TextDocument ) {
55
+ // Only lint if a compiler is specified
56
+ const config = vscode . workspace . getConfiguration ( 'fortran.linter' ) ;
57
+ if ( config . get < string > ( 'fortran.linter.compiler' ) === 'Disabled' ) return ;
55
58
// Only lint Fortran (free, fixed) format files
56
59
if (
57
60
! FortranDocumentSelector ( ) . some ( e => e . scheme === textDocument . uri . scheme ) ||
You can’t perform that action at this time.
0 commit comments