From 34bda3431ecef5fe318d3f9761134db24f9813d2 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, 18 Nov 2020 18:40:10 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/core/completion.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'script-beta/core') diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua index a1a35a92..840d4cd7 100644 --- a/script-beta/core/completion.lua +++ b/script-beta/core/completion.lua @@ -434,7 +434,11 @@ local function checkFieldOfRefs(refs, ast, word, start, offset, parent, oop, res goto CONTINUE end if isSameSource(ast, src, start) then - goto CONTINUE + -- 由于fastGlobal的优化,全局变量只会找出一个值,有可能找出自己 + -- 所以遇到自己的时候重新找一下有没有其他定义 + if #vm.getRefs(src) <= 1 then + goto CONTINUE + end end local name = key:sub(3) if locals and locals[name] then -- cgit v1.2.3