Commit 686e062 1 parent eb3717b commit 686e062 Copy full SHA for 686e062
File tree 1 file changed +14
-4
lines changed
src/features/providers/linter
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,21 @@ export default class LintingProvider {
31
31
vscode . workspace . onDidChangeConfiguration ( this . loadConfiguration , this , subscriptions ) ;
32
32
vscode . workspace . onDidOpenTextDocument ( this . triggerLint , this , subscriptions ) ;
33
33
vscode . workspace . onDidCloseTextDocument (
34
- ( textDocument ) => {
35
- if ( ! Configuration . lintEntireProject ( ) ) {
36
- this . diagnosticCollection . delete ( textDocument . uri ) ;
34
+ async ( textDocument ) => {
35
+ const { uri } = textDocument ;
36
+ let doesDocumentExist = true ;
37
+
38
+ try {
39
+ await vscode . workspace . fs . stat ( uri ) ;
40
+ } catch {
41
+ doesDocumentExist = false ;
42
+ }
43
+
44
+ if ( ! Configuration . lintEntireProject ( ) || ! vscode . workspace . getWorkspaceFolder ( uri ) || ! doesDocumentExist ) {
45
+ this . diagnosticCollection . delete ( uri ) ;
37
46
}
38
- delete this . delayers [ textDocument . uri . toString ( ) ] ;
47
+
48
+ delete this . delayers [ uri . toString ( ) ] ;
39
49
} ,
40
50
null ,
41
51
subscriptions
You can’t perform that action at this time.
0 commit comments