diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-08-15 19:25:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-08-15 19:25:31 +0800 |
commit | 390108b1bd06cc2bcd32e1ad7d62a76eccbd30cc (patch) | |
tree | b4b829d0cc8879e2b48eb1e66f0322d2902bf5c5 /script-beta | |
parent | 4fb4507cc87a854bbfcb3a234f4dea8f7df2f545 (diff) | |
download | lua-language-server-390108b1bd06cc2bcd32e1ad7d62a76eccbd30cc.zip |
调整一下延迟点
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/core/diagnostics/init.lua | 2 | ||||
-rw-r--r-- | script-beta/provider/diagnostic.lua | 1 |
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) |