From 089a1be03044af15bbbcab83aca27f00ac30aaa8 Mon Sep 17 00:00:00 2001 From: yini-chen Date: Wed, 18 Sep 2024 11:12:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=E6=96=87=E4=BB=B6=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E6=97=B6=E6=B8=85=E7=90=86=E8=AF=8A=E6=96=AD=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/provider/linter.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/provider/linter.ts b/src/provider/linter.ts index 7afab2d..42b4a4a 100644 --- a/src/provider/linter.ts +++ b/src/provider/linter.ts @@ -109,6 +109,12 @@ export async function registerLinter(context: vscode.ExtensionContext) { } }), ); + context.subscriptions.push( + vscode.workspace.onDidCloseTextDocument((document) => { + // 文件关闭(删除)后清空诊断 + collection.clear(); + }), + ); context.subscriptions.push( vscode.workspace.onDidChangeTextDocument((editor) => { if (editor) {