summaryrefslogtreecommitdiff
path: root/script-beta/parser/guide.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-17 19:49:33 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-17 19:49:33 +0800
commitf91735b40a6829df71547151ee72f42f4a9ed2fc (patch)
tree19e1c476f965e9db148dbdf516878570192bf5f0 /script-beta/parser/guide.lua
parente8e5e00ff910bbbd7729d473198eff92e7581e64 (diff)
downloadlua-language-server-f91735b40a6829df71547151ee72f42f4a9ed2fc.zip
优化自动完成的性能
Diffstat (limited to 'script-beta/parser/guide.lua')
-rw-r--r--script-beta/parser/guide.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 5ef81a18..daa648d6 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -16,6 +16,8 @@ local pairs = pairs
local setmetatable = setmetatable
local assert = assert
local select = select
+local osClock = os.clock
+local DEVELOP = DEVELOP
local _ENV = nil
@@ -2778,6 +2780,10 @@ function m.searchInfer(status, obj)
return
end
+ if DEVELOP then
+ status.cache.clock = status.cache.clock or osClock()
+ end
+
local checked = m.inferCheckLiteral(status, obj)
or m.inferCheckUnary(status, obj)
or m.inferCheckBinary(status, obj)