3939--- @param functionName string
4040--- @param source parser.object
4141--- @param diagnosticRangeSource ? parser.object sometimes the object with the data isn ' t the one that needs the diagnostics
42+ --- @param bindDocsSource ? parser.object sometimes the object with the bind docs isn ' t the value (`a.b = c` syntax)
4243--- @param callback fun ( result : any )
4344--- @param commentId string
4445--- @param paramId string
4546--- @param returnId string
46- local function checkFunctionNamed (functionName , source , diagnosticRangeSource , callback , commentId , paramId , returnId )
47+ local function checkFunctionNamed (functionName , source , diagnosticRangeSource , bindDocsSource , callback , commentId ,
48+ paramId , returnId )
4749 diagnosticRangeSource = diagnosticRangeSource or source
50+ bindDocsSource = bindDocsSource or source
4851 local argCount = diagnosticRangeSource .args and # diagnosticRangeSource .args or 0
4952
50- if argCount == 0 and not source .returns and not source .bindDocs then
53+ if argCount == 0 and not source .returns and not bindDocsSource .bindDocs then
5154 callback {
5255 start = diagnosticRangeSource .start ,
5356 finish = diagnosticRangeSource .finish ,
@@ -60,7 +63,7 @@ local function checkFunctionNamed(functionName, source, diagnosticRangeSource, c
6063 local argName = arg [1 ]
6164 if argName ~= ' self'
6265 and argName ~= ' _' then
63- if not findParam (source .bindDocs , argName ) then
66+ if not findParam (bindDocsSource .bindDocs , argName ) then
6467 callback {
6568 start = arg .start ,
6669 finish = arg .finish ,
@@ -74,7 +77,7 @@ local function checkFunctionNamed(functionName, source, diagnosticRangeSource, c
7477 if source .returns then
7578 for _ , ret in ipairs (source .returns ) do
7679 for index , expr in ipairs (ret ) do
77- if not findReturn (source .bindDocs , index ) then
80+ if not findReturn (bindDocsSource .bindDocs , index ) then
7881 callback {
7982 start = expr .start ,
8083 finish = expr .finish ,
9396--- @param returnId string
9497local function checkFunction (source , callback , commentId , paramId , returnId )
9598 local functionName = source .parent [1 ]
96- checkFunctionNamed (functionName , source , nil , callback , commentId , paramId , returnId )
99+ checkFunctionNamed (functionName , source , nil , nil , callback , commentId , paramId , returnId )
97100end
98101
99102
104107--- @param returnId string
105108local function checkMethod (source , callback , commentId , paramId , returnId )
106109 local functionName = source .method [1 ]
107- checkFunctionNamed (functionName , source .value , source .method , callback , commentId , paramId , returnId )
110+ checkFunctionNamed (functionName , source .value , source .method , nil , callback , commentId , paramId , returnId )
108111end
109112
110113m .CheckFunction = checkFunction
0 commit comments