summaryrefslogtreecommitdiff
path: root/script/provider/diagnostic.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-05 17:42:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-05 17:42:05 +0800
commit0a11d6f52abe6f0c913c5286b2da7598caf324e0 (patch)
tree03d8f3d12304320ff0ed784f2d8abc6ce75a4d90 /script/provider/diagnostic.lua
parent96fbddee50795421f3476140c0cfc0dac48c71a3 (diff)
downloadlua-language-server-0a11d6f52abe6f0c913c5286b2da7598caf324e0.zip
`diagnostics.workspaceRate`
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r--script/provider/diagnostic.lua27
1 files changed, 0 insertions, 27 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 09e1ea85..9f64cb88 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -168,28 +168,6 @@ function m.syntaxErrors(uri, ast)
end
---@async
-local function checkSleep(uri)
- local speedRate = config.get(uri, 'Lua.diagnostics.workspaceRate')
- if speedRate <= 0 or speedRate >= 100 then
- return
- end
- local currentClock = os.clock()
- local passed = currentClock - m.diagnosticsAllClock
- local sleepTime = passed * (100 - speedRate) / speedRate + m.sleepRest
- m.sleepRest = 0.0
- if sleepTime < 0.001 then
- m.sleepRest = m.sleepRest + sleepTime
- return
- end
- if sleepTime > 0.1 then
- m.sleepRest = sleepTime - 0.1
- sleepTime = 0.1
- end
- await.sleep(sleepTime)
- m.diagnosticsAllClock = os.clock()
-end
-
----@async
function m.doDiagnostic(uri, isScopeDiag)
if not config.get(uri, 'Lua.diagnostics.enable') then
return
@@ -266,10 +244,6 @@ function m.doDiagnostic(uri, isScopeDiag)
lastPushClock = os.clock()
pushResult()
end
-
- if isScopeDiag then
- checkSleep(uri)
- end
end)
pushResult()
@@ -354,7 +328,6 @@ function m.diagnosticsScope(uri, force)
await.close ('diagnosticsScope:' .. uri)
await.call(function () ---@async
await.sleep(delay)
- m.diagnosticsAllClock = os.clock()
local clock = os.clock()
local bar <close> = progress.create(ws.getScope(uri), lang.script.WORKSPACE_DIAGNOSTIC, 1)
local cancelled