summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-09 13:02:35 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-09 13:02:35 +0800
commitcea9695fd73b6d78093cba1e1eff468a2227ac79 (patch)
treebffc5c5f58ea777a575126f214f5e13999e62486
parent908a2dd6d5a0c959294aee635a9a6c1b6cc23669 (diff)
downloadlua-language-server-cea9695fd73b6d78093cba1e1eff468a2227ac79.zip
fix #946
don't assume the client will cache diagnostics
-rw-r--r--changelog.md1
-rw-r--r--script/provider/diagnostic.lua5
2 files changed, 6 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md
index a8204c91..9ab31581 100644
--- a/changelog.md
+++ b/changelog.md
@@ -7,6 +7,7 @@
* `FIX` [#941](https://github.com/sumneko/lua-language-server/issues/941)
* `FIX` [#941](https://github.com/sumneko/lua-language-server/issues/942)
* `FIX` [#943](https://github.com/sumneko/lua-language-server/issues/943)
+* `FIX` [#946](https://github.com/sumneko/lua-language-server/issues/946)
## 2.6.3
`2022-1-25`
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 2ca5830d..209e2aaa 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -253,6 +253,11 @@ function m.doDiagnostic(uri, isScopeDiag)
end
end
+ -- always re-sent diagnostics of current file
+ if not isScopeDiag then
+ m.cache[uri] = nil
+ end
+
pushResult()
local lastPushClock = os.clock()