summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-15 19:25:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-15 19:25:31 +0800
commit390108b1bd06cc2bcd32e1ad7d62a76eccbd30cc (patch)
treeb4b829d0cc8879e2b48eb1e66f0322d2902bf5c5 /script-beta
parent4fb4507cc87a854bbfcb3a234f4dea8f7df2f545 (diff)
downloadlua-language-server-390108b1bd06cc2bcd32e1ad7d62a76eccbd30cc.zip
调整一下延迟点
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/core/diagnostics/init.lua2
-rw-r--r--script-beta/provider/diagnostic.lua1
2 files changed, 2 insertions, 1 deletions
diff --git a/script-beta/core/diagnostics/init.lua b/script-beta/core/diagnostics/init.lua
index 0d523f26..1a2ff4b7 100644
--- a/script-beta/core/diagnostics/init.lua
+++ b/script-beta/core/diagnostics/init.lua
@@ -18,7 +18,6 @@ local function check(uri, name, level, results)
local passed = os.clock() - clock
if passed >= 0.5 then
log.warn(('Diagnostics [%s] @ [%s] takes [%.3f] sec!'):format(name, uri, passed))
- await.delay()
end
end
@@ -30,6 +29,7 @@ return function (uri)
local results = {}
for name, level in pairs(define.DiagnosticDefaultSeverity) do
+ await.delay()
check(uri, name, level, results)
end
diff --git a/script-beta/provider/diagnostic.lua b/script-beta/provider/diagnostic.lua
index 1b4bab02..34cec966 100644
--- a/script-beta/provider/diagnostic.lua
+++ b/script-beta/provider/diagnostic.lua
@@ -221,6 +221,7 @@ files.watch(function (env, uri)
m.clear(uri)
elseif env == 'update' then
await.create(function ()
+ -- 一旦文件的版本发生变化,就放弃这次诊断
await.setDelayer(function ()
return files.getVersion(uri)
end)