summaryrefslogtreecommitdiff
path: root/script/core/hover
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-28 17:44:46 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-28 17:44:46 +0800
commitc45a21271556b6c689ee61fd5353846f469e4622 (patch)
treedf0ce3ef26ba916b230ffc27e25168e3947f2273 /script/core/hover
parentf1a974b7ea759adcd4af571bc7752d5b4761927b (diff)
downloadlua-language-server-c45a21271556b6c689ee61fd5353846f469e4622.zip
#477 supports hover
Diffstat (limited to 'script/core/hover')
-rw-r--r--script/core/hover/description.lua14
1 files changed, 4 insertions, 10 deletions
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua
index fc220c74..f0534373 100644
--- a/script/core/hover/description.lua
+++ b/script/core/hover/description.lua
@@ -344,16 +344,10 @@ local function tyrDocParamComment(source)
if source.parent.type ~= 'funcargs' then
return
end
- if not source.bindDocs then
- return
- end
- for _, doc in ipairs(source.bindDocs) do
- if doc.type == 'doc.param' then
- if doc.param[1] == source[1] then
- if doc.comment then
- return doc.comment.text
- end
- break
+ for _, def in ipairs(vm.getDefs(source)) do
+ if def.type == 'doc.param' then
+ if def.comment then
+ return def.comment.text
end
end
end