summaryrefslogtreecommitdiff
path: root/script-beta/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-19 14:55:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-19 14:55:45 +0800
commita1c4ebfb23152e23bf556811aad39bf917c5cb60 (patch)
treec7475f07cf56d31fd3c2a12579c8a043d8090034 /script-beta/core
parent2502bd442e43d4bd196416b4c0d7777d21352830 (diff)
downloadlua-language-server-a1c4ebfb23152e23bf556811aad39bf917c5cb60.zip
整理代码
Diffstat (limited to 'script-beta/core')
-rw-r--r--script-beta/core/completion.lua22
1 files changed, 1 insertions, 21 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 1a7267ce..479d6ab4 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -356,26 +356,6 @@ local function checkFieldFromFieldToIndex(name, parent, word, start, offset)
return textEdit, additionalTextEdits
end
-local function isDeprecated(value)
- if value.deprecated then
- return true
- end
- if not value.bindDocs then
- return false
- end
- for _, doc in ipairs(value.bindDocs) do
- if doc.type == 'doc.deprecated' then
- return true
- elseif doc.type == 'doc.version' then
- local valids = vm.getValidVersions(doc)
- if not valids[config.config.runtime.version] then
- return true
- end
- end
- end
- return false
-end
-
local function checkFieldThen(name, src, word, start, offset, parent, oop, results)
local value = guide.getObjectValue(src) or src
local kind = define.CompletionItemKind.Field
@@ -388,7 +368,7 @@ local function checkFieldThen(name, src, word, start, offset, parent, oop, resul
buildFunction(results, src, oop, {
label = name,
kind = kind,
- deprecated = isDeprecated(value) or nil,
+ deprecated = vm.isDeprecated(value) or nil,
id = stack(function ()
return {
detail = buildDetail(src),