File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
74
74
75
75
### Fixed
76
76
77
+ - Fixed bug where diagnostic messages would linger from the previous state
78
+ ([ #706 ] ( https://github.com/fortran-lang/vscode-fortran-support/issues/706 ) )
77
79
- Fixed activation bug on Windows causing the persistent cache to fail
78
80
([ #700 ] ( https://github.com/fortran-lang/vscode-fortran-support/issues/700 ) )
79
81
- Fixed bug where the linter's internal cache directory would not always exist
Original file line number Diff line number Diff line change @@ -329,8 +329,12 @@ export class FortranLintingProvider {
329
329
if ( ! isFortran ( document ) ) return ;
330
330
331
331
const output = await this . doBuild ( document ) ;
332
- if ( ! output ) return ;
333
-
332
+ if ( ! output ) {
333
+ // If the linter output is now empty, then there are no errors.
334
+ // Discard the previous diagnostic state for this document
335
+ if ( this . fortranDiagnostics . has ( document . uri ) ) this . fortranDiagnostics . delete ( document . uri ) ;
336
+ return ;
337
+ }
334
338
let diagnostics : vscode . Diagnostic [ ] = this . linter . parse ( output ) ;
335
339
// Remove duplicates from the diagnostics array
336
340
diagnostics = [ ...new Map ( diagnostics . map ( v => [ JSON . stringify ( v ) , v ] ) ) . values ( ) ] ;
You can’t perform that action at this time.
0 commit comments