summaryrefslogtreecommitdiff
path: root/server-beta/src/core/field.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-10 15:29:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-10 15:29:00 +0800
commited0531411e854bcebdc8ac3988bf2631beaf6a40 (patch)
treea4ab13efc7fc0811376756b643e187b3b91b7412 /server-beta/src/core/field.lua
parentbe391ed25a3c560bac363c9ead702c1ad41e7488 (diff)
downloadlua-language-server-ed0531411e854bcebdc8ac3988bf2631beaf6a40.zip
更新
Diffstat (limited to 'server-beta/src/core/field.lua')
-rw-r--r--server-beta/src/core/field.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/server-beta/src/core/field.lua b/server-beta/src/core/field.lua
index 1304eeab..cd50d713 100644
--- a/server-beta/src/core/field.lua
+++ b/server-beta/src/core/field.lua
@@ -5,19 +5,21 @@ local m = {}
function m:def(source, callback)
local node = source.parent.node
local key = guide.getKeyName(source)
- self:eachField(node, key, 'def', callback)
+ self:eachField(node, key, function (src, mode)
+ if mode == 'set' then
+ callback(src, mode)
+ end
+ end)
end
function m:ref(source, callback)
local node = source.parent.node
local key = guide.getKeyName(source)
- self:eachField(node, key, 'ref', callback)
-end
-
-function m:field(source, callback)
- local node = source.parent.node
- local key = guide.getKeyName(source)
- self:eachField(node, key, 'field', callback)
+ self:eachField(node, key, function (src, mode)
+ if mode == 'set' or mode == 'get' then
+ callback(src, mode)
+ end
+ end)
end
return m