diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-10 15:29:00 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-10 15:29:00 +0800 |
commit | ed0531411e854bcebdc8ac3988bf2631beaf6a40 (patch) | |
tree | a4ab13efc7fc0811376756b643e187b3b91b7412 /server-beta/src/core/table.lua | |
parent | be391ed25a3c560bac363c9ead702c1ad41e7488 (diff) | |
download | lua-language-server-ed0531411e854bcebdc8ac3988bf2631beaf6a40.zip |
更新
Diffstat (limited to 'server-beta/src/core/table.lua')
-rw-r--r-- | server-beta/src/core/table.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/server-beta/src/core/table.lua b/server-beta/src/core/table.lua index 1f6c45c4..36f4f887 100644 --- a/server-beta/src/core/table.lua +++ b/server-beta/src/core/table.lua @@ -1,11 +1,16 @@ +local guide = require 'parser.guide' + local m = {} -function m:field(source, callback) +function m:field(source, key, callback) for i = 1, #source do local src = source[i] - if src.type == 'tablefield' - or src.type == 'tableindex' then - callback(src) + if key == guide.getKeyName(src) then + if src.type == 'tablefield' then + callback(src.field, 'set') + elseif src.type == 'tableindex' then + callback(src.index, 'set') + end end end end |