File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,14 @@ export class DiagnosticsApi {
76
76
filesToLoad . push ( this . _selectedEntry . file ) ;
77
77
}
78
78
79
+ // Unload reports without calling parse
80
+ if ( filesToLoad . length === 0 ) {
81
+ this . _diagnosticEntries = new Map ( ) ;
82
+ this . _diagnosticsUpdated . fire ( ) ;
83
+
84
+ return ;
85
+ }
86
+
79
87
ExtensionApi . executorBridge . parseMetadata ( ...filesToLoad . map ( file => Uri . file ( file ) ) )
80
88
. catch ( ( err : any ) => console . log ( `Internal error in reloadDiagnostics: ${ err } ` ) ) ;
81
89
}
@@ -143,9 +151,20 @@ export class DiagnosticsApi {
143
151
}
144
152
145
153
private onDocumentsChanged ( event : TextEditor [ ] ) : void {
146
- this . _openedFiles = event . map ( editor => editor . document . uri . fsPath ) ;
147
-
148
- this . reloadDiagnostics ( ) ;
154
+ const newFiles = event
155
+ // Filters out the Output tab's extra events
156
+ . filter ( editor => editor . document . uri . scheme !== 'output' )
157
+ . map ( editor => editor . document . uri . fsPath )
158
+ . sort ( ) ;
159
+
160
+ // Only reload diagnostics when files are changed
161
+ if (
162
+ this . _openedFiles . length !== newFiles . length ||
163
+ this . _openedFiles . some ( ( filePath , idx ) => filePath !== newFiles [ idx ] )
164
+ ) {
165
+ this . _openedFiles = newFiles ;
166
+ this . reloadDiagnostics ( ) ;
167
+ }
149
168
}
150
169
151
170
private onMetadataUpdated ( _metadata : CheckerMetadata | undefined ) {
You can’t perform that action at this time.
0 commit comments