summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-23 20:53:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-23 20:53:07 +0800
commite7e7a337a07999a610d903d14aa6e774baa16a8c (patch)
treedf98e9df32149da158a00b944af74d0205749156 /script
parent64b7635a5022a13df67acc5632497d75b3c378c7 (diff)
downloadlua-language-server-e7e7a337a07999a610d903d14aa6e774baa16a8c.zip
improve completion of field and table
Diffstat (limited to 'script')
-rw-r--r--script/core/completion.lua12
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