File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 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)
157157 checkSee (source , results )
158158
159159 local defs = vm .getDefs (source )
160+ local result_set = {}
161+ for _ , src in ipairs (defs ) do
162+ result_set [src ] = true
163+ end
160164
161165 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
162174 if src .type == ' global' then
163175 goto CONTINUE
164176 end
Original file line number Diff line number Diff line change 2424]]
2525
2626TEST [[
27- local <!f!> = <!function () end!>
27+ local <!f!> = function () end
28+ <!f!> = function () end
29+ <!f!> = function () end
2830<?f?>()
2931]]
You can’t perform that action at this time.
0 commit comments