summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-15 18:04:16 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-15 18:04:16 +0800
commit82d716ccaa8ebab931fd2328faa4f4c5a76eb99a (patch)
treeaaebc8675ed44c172283b9979817bf023c29675e /script/vm
parentac3235f4e9b800b0726a2e90555b109d5b58abfb (diff)
downloadlua-language-server-82d716ccaa8ebab931fd2328faa4f4c5a76eb99a.zip
resolve #1224 show comments for `doc.field`
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/def.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/script/vm/def.lua b/script/vm/def.lua
index a7af29b2..f557f221 100644
--- a/script/vm/def.lua
+++ b/script/vm/def.lua
@@ -102,9 +102,15 @@ local nodeSwitch;nodeSwitch = util.switch()
if lastKey then
return
end
- local tbl = source.parent
+ local key = guide.getKeyName(source)
+ if type(key) ~= 'string' then
+ return
+ end
local uri = guide.getUri(source)
- searchFieldSwitch(tbl.type, uri, tbl, guide.getKeyName(source), pushResult)
+ local parentNode = vm.compileNode(source.node)
+ for pn in parentNode:eachObject() do
+ searchFieldSwitch(pn.type, uri, pn, key, pushResult)
+ end
end)
: case 'doc.see.field'
: call(function (source, lastKey, pushResult)