From a1c4ebfb23152e23bf556811aad39bf917c5cb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 19 Nov 2020 14:55:45 +0800 Subject: =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/core/completion.lua | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'script-beta/core') 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), -- cgit v1.2.3