diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-18 18:40:10 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-18 18:40:10 +0800 |
commit | 34bda3431ecef5fe318d3f9761134db24f9813d2 (patch) | |
tree | 82f42d4ee824789979c99c73a16b4ef1f9900170 /script-beta/core | |
parent | f170f8d14a8d607db9cc9447c6e562c0649817fd (diff) | |
download | lua-language-server-34bda3431ecef5fe318d3f9761134db24f9813d2.zip |
修正一个bug
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/completion.lua | 6 |
1 files changed, 5 insertions, 1 deletions
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 |