Skip to content

Commit

Permalink
Merge pull request #150 from jackfrey13/problems-tab-fix
Browse files Browse the repository at this point in the history
Improved Handling for Problems in Closed/Deleted Files
  • Loading branch information
RobertOstermann authored Jul 25, 2024
2 parents eb3717b + 686e062 commit e4d9953
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/features/providers/linter/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,21 @@ export default class LintingProvider {
vscode.workspace.onDidChangeConfiguration(this.loadConfiguration, this, subscriptions);
vscode.workspace.onDidOpenTextDocument(this.triggerLint, this, subscriptions);
vscode.workspace.onDidCloseTextDocument(
(textDocument) => {
if (!Configuration.lintEntireProject()) {
this.diagnosticCollection.delete(textDocument.uri);
async (textDocument) => {
const { uri } = textDocument;
let doesDocumentExist = true;

try {
await vscode.workspace.fs.stat(uri);
} catch {
doesDocumentExist = false;
}

if (!Configuration.lintEntireProject() || !vscode.workspace.getWorkspaceFolder(uri) || !doesDocumentExist) {
this.diagnosticCollection.delete(uri);
}
delete this.delayers[textDocument.uri.toString()];

delete this.delayers[uri.toString()];
},
null,
subscriptions
Expand Down

0 comments on commit e4d9953

Please sign in to comment.