summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-06 15:17:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-06 15:17:23 +0800
commit997109ebfd4e9ec2bd2b22cc8c35fd1e7cdf0b91 (patch)
tree087232d92bd2cfde5178420c5efff70823cfca31 /script
parenteeb24f394050578dd575e6c9035230c0d51b2672 (diff)
downloadlua-language-server-997109ebfd4e9ec2bd2b22cc8c35fd1e7cdf0b91.zip
improve diag
Diffstat (limited to 'script')
-rw-r--r--script/core/diagnostics/init.lua19
-rw-r--r--script/provider/diagnostic.lua2
2 files changed, 12 insertions, 9 deletions
diff --git a/script/core/diagnostics/init.lua b/script/core/diagnostics/init.lua
index fd67ac2e..c33de6ce 100644
--- a/script/core/diagnostics/init.lua
+++ b/script/core/diagnostics/init.lua
@@ -8,14 +8,17 @@ local diagd = require 'proto.diagnostic'
-- 把耗时最长的诊断放到最后面
local diagSort = {
- ['redundant-value'] = 100,
- ['not-yieldable'] = 100,
- ['deprecated'] = 100,
- ['undefined-field'] = 110,
- ['redundant-parameter'] = 110,
- ['cast-local-type'] = 120,
- ['assign-type-mismatch'] = 120,
- ['param-type-mismatch'] = 120,
+ ['redundant-value'] = 100,
+ ['not-yieldable'] = 100,
+ ['deprecated'] = 100,
+ ['undefined-field'] = 110,
+ ['redundant-parameter'] = 110,
+ ['cast-local-type'] = 120,
+ ['assign-type-mismatch'] = 120,
+ ['param-type-mismatch'] = 120,
+ ['missing-return'] = 120,
+ ['missing-return-value'] = 120,
+ ['redundant-return-value'] = 120,
}
local diagList = {}
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 58940d2e..762b8d50 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -308,7 +308,7 @@ function m.doDiagnostic(uri, isScopeDiag)
xpcall(core, log.error, uri, isScopeDiag, function (result)
diags[#diags+1] = buildDiagnostic(uri, result)
- if not isScopeDiag and time.time() - lastPushClock >= 1000 then
+ if not isScopeDiag and time.time() - lastPushClock >= 500 then
lastPushClock = time.time()
pushResult()
end