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 ,
104104--- @param returnId string
105105local 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 )
108108end
109109
110110m .CheckFunction = checkFunction
0 commit comments