From 0115abdc5438189b9c0f0c1a5b1946a7ee1f85a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 14 Jul 2021 21:44:18 +0800 Subject: fix --- script/core/diagnostics/newfield-call.lua | 3 +++ script/provider/diagnostic.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/script/core/diagnostics/newfield-call.lua b/script/core/diagnostics/newfield-call.lua index 27ac6fce..fe86ad66 100644 --- a/script/core/diagnostics/newfield-call.lua +++ b/script/core/diagnostics/newfield-call.lua @@ -21,6 +21,9 @@ return function (uri, callback) if not call then goto CONTINUE end + if call.type ~= 'call' then + return + end local func = call.node local args = call.args if args then diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 3575afbb..5d3b00ea 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -169,7 +169,7 @@ function m.diagnostics(uri, diags) return end - core(uri, function (results) + xpcall(core, log.error, uri, function (results) if #results == 0 then return end -- cgit v1.2.3