summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-08 17:31:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-08 17:31:40 +0800
commit103aee69bf717936432e2739695305ce2058786e (patch)
tree16dc53cecd38bb234b5caa01f3035da9893ca165 /script/parser/luadoc.lua
parent7c29a6012bf5fe2cc1ff79598f8be6f80528e767 (diff)
downloadlua-language-server-103aee69bf717936432e2739695305ce2058786e.zip
cleanup
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 1b538e84..d0c06ea6 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -1588,6 +1588,13 @@ local function bindGeneric(binded)
end
local function bindDoc(source, binded)
+ local isParam = source.type == 'self'
+ or source.type == 'local'
+ and (source.parent.type == 'funcargs'
+ or ( source.parent.type == 'in'
+ and source.finish <= source.parent.keys.finish
+ )
+ )
local ok = false
for _, doc in ipairs(binded) do
if doc.bindSource then
@@ -1599,7 +1606,7 @@ local function bindDoc(source, binded)
or doc.type == 'doc.version'
or doc.type == 'doc.module' then
if source.type == 'function'
- or source.type == 'self' then
+ or isParam then
goto CONTINUE
end
elseif doc.type == 'doc.overload' then
@@ -1612,13 +1619,8 @@ local function bindDoc(source, binded)
end
elseif doc.type == 'doc.param' then
local suc
- if source.type == 'local'
- and doc.param[1] == source[1]
- and ( source.parent.type == 'funcargs'
- or ( source.parent.type == 'in'
- and source.finish <= source.parent.keys.finish
- )
- ) then
+ if isParam
+ and doc.param[1] == source[1] then
suc = true
elseif source.type == '...'
and doc.param[1] == '...' then