summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-09 13:16:37 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-09 13:16:37 +0800
commit7321df77c443853370cbb10acd619a0073c55a13 (patch)
tree064917ead0c6df3ae4a70f32fc301122362cbeeb /script/provider
parentcea9695fd73b6d78093cba1e1eff468a2227ac79 (diff)
downloadlua-language-server-7321df77c443853370cbb10acd619a0073c55a13.zip
use `time.time` instead of `os.clock`
the implementation of os.clock under the windows platform is inconsistent with other platforms
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/diagnostic.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 209e2aaa..d0de0962 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -12,6 +12,7 @@ local client = require 'client'
local converter = require 'proto.converter'
local loading = require 'workspace.loading'
local scope = require 'workspace.scope'
+local time = require 'bee.time'
---@class diagnosticProvider
local m = {}
@@ -260,13 +261,13 @@ function m.doDiagnostic(uri, isScopeDiag)
pushResult()
- local lastPushClock = os.clock()
+ local lastPushClock = time.time()
---@async
xpcall(core, log.error, uri, isScopeDiag, function (result)
diags[#diags+1] = buildDiagnostic(uri, result)
- if not isScopeDiag and os.clock() - lastPushClock >= 0.2 then
- lastPushClock = os.clock()
+ if not isScopeDiag and time.time() - lastPushClock >= 200 then
+ lastPushClock = time.time()
pushResult()
end
end, function (checkedName)