File tree 2 files changed +15
-1
lines changed 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -157,8 +157,20 @@ return function (uri, offset)
157
157
checkSee (source , results )
158
158
159
159
local defs = vm .getDefs (source )
160
+ local result_set = {}
161
+ for _ , src in ipairs (defs ) do
162
+ result_set [src ] = true
163
+ end
160
164
161
165
for _ , src in ipairs (defs ) do
166
+ -- If the node is a child of the same line, canonicalize the definition to the parent node.
167
+ if result_set [src .parent ] then
168
+ local parent_line = math.floor (src .parent .start / 10000 )
169
+ local src_line = math.floor (src .start / 10000 )
170
+ if parent_line == src_line then
171
+ goto CONTINUE
172
+ end
173
+ end
162
174
if src .type == ' global' then
163
175
goto CONTINUE
164
176
end
Original file line number Diff line number Diff line change 24
24
]]
25
25
26
26
TEST [[
27
- local <!f!> = <!function () end!>
27
+ local <!f!> = function () end
28
+ <!f!> = function () end
29
+ <!f!> = function () end
28
30
<?f?>()
29
31
]]
You can’t perform that action at this time.
0 commit comments