Skip to content

Commit 65909aa

Browse files
committed
fix(diagnostics): fix undocumented method returns never being ignored for missing-export-doc
1 parent f644444 commit 65909aa

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

script/core/diagnostics/helper/missing-doc-helper.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ end
3838

3939
---@param functionName string
4040
---@param source parser.object
41-
---@param bindDocsSource parser.object? sometimes the object with the bindDocs isn't the function, use this to specify what has them
41+
---@param diagnosticRangeSource? parser.object sometimes the object with the data isn't the one that needs the diagnostics
4242
---@param callback fun(result: any)
4343
---@param commentId string
4444
---@param paramId string
4545
---@param returnId string
46-
local function checkFunctionNamed(functionName, source, bindDocsSource, callback, commentId, paramId, returnId)
47-
local argCount = source.args and #source.args or 0
48-
bindDocsSource = bindDocsSource or source
46+
local function checkFunctionNamed(functionName, source, diagnosticRangeSource, callback, commentId, paramId, returnId)
47+
diagnosticRangeSource = diagnosticRangeSource or source
48+
local argCount = diagnosticRangeSource.args and #diagnosticRangeSource.args or 0
4949

50-
if argCount == 0 and not source.returns and not bindDocsSource.bindDocs then
50+
if argCount == 0 and not source.returns and not source.bindDocs then
5151
callback {
52-
start = source.start,
53-
finish = source.finish,
52+
start = diagnosticRangeSource.start,
53+
finish = diagnosticRangeSource.finish,
5454
message = lang.script(commentId, functionName),
5555
}
5656
end
@@ -60,7 +60,7 @@ local function checkFunctionNamed(functionName, source, bindDocsSource, callback
6060
local argName = arg[1]
6161
if argName ~= 'self'
6262
and argName ~= '_' then
63-
if not findParam(bindDocsSource.bindDocs, argName) then
63+
if not findParam(source.bindDocs, argName) then
6464
callback {
6565
start = arg.start,
6666
finish = arg.finish,
@@ -104,7 +104,7 @@ end
104104
---@param returnId string
105105
local function checkMethod(source, callback, commentId, paramId, returnId)
106106
local functionName = source.method[1]
107-
checkFunctionNamed(functionName, source.method, source.value, callback, commentId, paramId, returnId)
107+
checkFunctionNamed(functionName, source.value, source.method, callback, commentId, paramId, returnId)
108108
end
109109

110110
m.CheckFunction = checkFunction

0 commit comments

Comments
 (0)