summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-24 19:32:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-24 19:32:23 +0800
commit2a3f40432c1e6de9f40e9fd9c222a95fa7ad4317 (patch)
tree3bf30f66317d2ff637c41ff7f943df641275df6f /script/vm
parent7cb37a0ef7f9cb9ec429cd29e770b7bc6e72a2aa (diff)
downloadlua-language-server-2a3f40432c1e6de9f40e9fd9c222a95fa7ad4317.zip
some cache
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/getDocs.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 8be543fe..533cd78d 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -84,6 +84,9 @@ function vm.getValidVersions(doc)
if doc.type ~= 'doc.version' then
return
end
+ if doc._validVersions then
+ return doc._validVersions
+ end
local valids = {
['Lua 5.1'] = false,
['Lua 5.2'] = false,
@@ -115,6 +118,7 @@ function vm.getValidVersions(doc)
if valids['Lua 5.1'] then
valids['LuaJIT'] = true
end
+ doc._validVersions = valids
return valids
end
@@ -122,16 +126,22 @@ local function isDeprecated(value)
if not value.bindDocs then
return false
end
+ if value._deprecated ~= nil then
+ return value._deprecated
+ end
for _, doc in ipairs(value.bindDocs) do
if doc.type == 'doc.deprecated' then
+ value._deprecated = true
return true
elseif doc.type == 'doc.version' then
local valids = vm.getValidVersions(doc)
if not valids[config.config.runtime.version] then
+ value._deprecated = true
return true
end
end
end
+ value._deprecated = false
return false
end