diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-08-17 19:49:33 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-08-17 19:49:33 +0800 |
commit | f91735b40a6829df71547151ee72f42f4a9ed2fc (patch) | |
tree | 19e1c476f965e9db148dbdf516878570192bf5f0 /script-beta/parser/guide.lua | |
parent | e8e5e00ff910bbbd7729d473198eff92e7581e64 (diff) | |
download | lua-language-server-f91735b40a6829df71547151ee72f42f4a9ed2fc.zip |
优化自动完成的性能
Diffstat (limited to 'script-beta/parser/guide.lua')
-rw-r--r-- | script-beta/parser/guide.lua | 6 |
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) |