summaryrefslogtreecommitdiff
path: root/script-beta/core/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-19 00:45:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-19 00:45:12 +0800
commit62993f3889d0af482549de720c77b23cb0ff815f (patch)
treedd42eb8fe6e37fc29877c56e114011ec6b45ea47 /script-beta/core/completion.lua
parent5bb8b661844890c933b34139260a59a5cea45c8d (diff)
downloadlua-language-server-62993f3889d0af482549de720c77b23cb0ff815f.zip
换一个做法
Diffstat (limited to 'script-beta/core/completion.lua')
-rw-r--r--script-beta/core/completion.lua25
1 files changed, 3 insertions, 22 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 421ccf90..8ff374b7 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -367,29 +367,10 @@ local function isDeprecated(value)
if doc.type == 'doc.deprecated' then
return true
elseif doc.type == 'doc.version' then
- local ver, jit
- if config.config.runtime.version == 'LuaJIT' then
- ver = 5.1
- jit = true
- else
- ver = tonumber(config.config.runtime.version:sub(-3))
- jit = false
- if not ver then
- return true
- end
+ local valids = vm.getValidVersions(doc)
+ if not valids[config.config.runtime.version] then
+ return true
end
- for _, version in ipairs(doc.versions) do
- if version.ge and ver >= version.version then
- return false
- elseif version.le and ver <= version.version then
- return false
- elseif ver == version.version then
- return false
- elseif jit and 'JIT' == version.version then
- return false
- end
- end
- return true
end
end
return false