Skip to content

Commit 997109e

Browse files
committed
improve diag
1 parent eeb24f3 commit 997109e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

script/core/diagnostics/init.lua

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ local diagd = require 'proto.diagnostic'
88

99
-- 把耗时最长的诊断放到最后面
1010
local diagSort = {
11-
['redundant-value'] = 100,
12-
['not-yieldable'] = 100,
13-
['deprecated'] = 100,
14-
['undefined-field'] = 110,
15-
['redundant-parameter'] = 110,
16-
['cast-local-type'] = 120,
17-
['assign-type-mismatch'] = 120,
18-
['param-type-mismatch'] = 120,
11+
['redundant-value'] = 100,
12+
['not-yieldable'] = 100,
13+
['deprecated'] = 100,
14+
['undefined-field'] = 110,
15+
['redundant-parameter'] = 110,
16+
['cast-local-type'] = 120,
17+
['assign-type-mismatch'] = 120,
18+
['param-type-mismatch'] = 120,
19+
['missing-return'] = 120,
20+
['missing-return-value'] = 120,
21+
['redundant-return-value'] = 120,
1922
}
2023

2124
local diagList = {}

script/provider/diagnostic.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ function m.doDiagnostic(uri, isScopeDiag)
308308
xpcall(core, log.error, uri, isScopeDiag, function (result)
309309
diags[#diags+1] = buildDiagnostic(uri, result)
310310

311-
if not isScopeDiag and time.time() - lastPushClock >= 1000 then
311+
if not isScopeDiag and time.time() - lastPushClock >= 500 then
312312
lastPushClock = time.time()
313313
pushResult()
314314
end

0 commit comments

Comments
 (0)