summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-30 10:15:14 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-30 10:15:14 +0800
commitb40bd51dea3d6fb603cc437c17041938e985d29f (patch)
tree88602be147f429f1e4d912b19693e0cadf6b99ff
parentd436de5f3b1ea67cac6006a2838c95d7b4fa5ac5 (diff)
downloadlua-language-server-b40bd51dea3d6fb603cc437c17041938e985d29f.zip
clear diagnostic when closing library file
-rw-r--r--script/provider/diagnostic.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index aa804faf..496b06fc 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -297,6 +297,10 @@ files.watch(function (ev, uri)
m.refresh(uri)
elseif ev == 'open' then
m.doDiagnostic(uri)
+ elseif ev == 'close' then
+ if files.isLibrary(uri) then
+ m.clear(uri)
+ end
end
end)