diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-23 17:31:02 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-23 17:31:02 +0800 |
commit | 4248038716c6c2281a10af9c0a3f04c6468b1946 (patch) | |
tree | 79361f8df2cf46ab99843e84bba175ea60147da2 /server-beta/src/searcher-old/table.lua | |
parent | 68541432820dfff4554375c4c424a537943a938d (diff) | |
download | lua-language-server-4248038716c6c2281a10af9c0a3f04c6468b1946.zip |
准备换一个写法试试
Diffstat (limited to 'server-beta/src/searcher-old/table.lua')
-rw-r--r-- | server-beta/src/searcher-old/table.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/server-beta/src/searcher-old/table.lua b/server-beta/src/searcher-old/table.lua new file mode 100644 index 00000000..fa9a064a --- /dev/null +++ b/server-beta/src/searcher-old/table.lua @@ -0,0 +1,30 @@ +local guide = require 'parser.guide' + +local m = {} + +function m:eachField(source, key, callback) + for i = 1, #source do + local src = source[i] + if key == guide.getKeyName(src) then + if src.type == 'tablefield' then + callback { + source = src, + uri = self.uri, + mode = 'set', + } + elseif src.type == 'tableindex' then + callback { + source = src, + uri = self.uri, + mode = 'set', + } + end + end + end +end + +function m:getValue(source) + return source +end + +return m |