summaryrefslogtreecommitdiff
path: root/server-beta/src/core/setmethod.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-17 19:30:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-17 19:30:38 +0800
commitc8175c13c19cb6be4d2690d0a8fde6f04210ba51 (patch)
treec2e297b4d62e19a92625edf6bfadfb58dfcb2787 /server-beta/src/core/setmethod.lua
parent9cfe34795e2cb31b7b1e7f30cf9988ae360857c7 (diff)
downloadlua-language-server-c8175c13c19cb6be4d2690d0a8fde6f04210ba51.zip
整理代码
Diffstat (limited to 'server-beta/src/core/setmethod.lua')
-rw-r--r--server-beta/src/core/setmethod.lua26
1 files changed, 17 insertions, 9 deletions
diff --git a/server-beta/src/core/setmethod.lua b/server-beta/src/core/setmethod.lua
index 3736663b..881b5083 100644
--- a/server-beta/src/core/setmethod.lua
+++ b/server-beta/src/core/setmethod.lua
@@ -16,15 +16,17 @@ function m:field(source, key, callback)
callback(source, 'set')
end
- self:eachField(node, key, function (src, mode)
- if used[src] then
- return
- end
- used[src] = true
- if mode == 'set' then
- callback(src, mode)
- found = true
- end
+ self:eachField(node, myKey, function (src, mode)
+ self:eachField(src, key, function (src, mode)
+ if used[src] then
+ return
+ end
+ used[src] = true
+ if mode == 'set' then
+ callback(src, mode)
+ found = true
+ end
+ end)
end)
self:eachValue(node, function (src)
@@ -43,4 +45,10 @@ function m:field(source, key, callback)
checkSMT(self, key, used, found, callback)
end
+function m:value(source, callback)
+ if source.value then
+ self:eachValue(source.value, callback)
+ end
+end
+
return m