From e7e7a337a07999a610d903d14aa6e774baa16a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 23 Feb 2021 20:53:07 +0800 Subject: improve completion of field and table --- script/core/completion.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'script') diff --git a/script/core/completion.lua b/script/core/completion.lua index 8780c215..8bba81b2 100644 --- a/script/core/completion.lua +++ b/script/core/completion.lua @@ -1102,11 +1102,23 @@ local function checkEqualEnum(ast, text, offset, results) or source.type == 'setlocal' or source.type == 'local' or source.type == 'getglobal' + or source.type == 'setglobal' or source.type == 'getfield' + or source.type == 'setfield' or source.type == 'getindex' + or source.type == 'setindex' + or source.type == 'tablefield' + or source.type == 'tableindex' or source.type == 'call' then return source end + local parent = source.parent + if parent then + if parent.type == 'tablefield' + or parent.type == 'tableindex' then + return source + end + end end) if not source then return -- cgit v1.2.3