From 1c226d739cc96f83e57b41b39e38692d16679803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 16 Oct 2020 17:07:02 +0800 Subject: =?UTF-8?q?=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/core/hover/name.lua | 3 +++ script-beta/core/semantic-tokens.lua | 3 +++ 2 files changed, 6 insertions(+) (limited to 'script-beta/core') diff --git a/script-beta/core/hover/name.lua b/script-beta/core/hover/name.lua index 83b779db..a1c40771 100644 --- a/script-beta/core/hover/name.lua +++ b/script-beta/core/hover/name.lua @@ -29,6 +29,9 @@ local function asField(source) end local function asTableField(source) + if not source.field then + return + end return guide.getName(source.field) end diff --git a/script-beta/core/semantic-tokens.lua b/script-beta/core/semantic-tokens.lua index 25b66adc..996ebb98 100644 --- a/script-beta/core/semantic-tokens.lua +++ b/script-beta/core/semantic-tokens.lua @@ -39,6 +39,9 @@ Care['getglobal'] = function (source, results) end Care['tablefield'] = function (source, results) local field = source.field + if not field then + return + end results[#results+1] = { start = field.start, finish = field.finish, -- cgit v1.2.3