diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-02-23 20:53:07 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-02-23 20:53:07 +0800 |
commit | e7e7a337a07999a610d903d14aa6e774baa16a8c (patch) | |
tree | df98e9df32149da158a00b944af74d0205749156 /script | |
parent | 64b7635a5022a13df67acc5632497d75b3c378c7 (diff) | |
download | lua-language-server-e7e7a337a07999a610d903d14aa6e774baa16a8c.zip |
improve completion of field and table
Diffstat (limited to 'script')
-rw-r--r-- | script/core/completion.lua | 12 |
1 files changed, 12 insertions, 0 deletions
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 |