File tree Expand file tree Collapse file tree 2 files changed +47
-8
lines changed Expand file tree Collapse file tree 2 files changed +47
-8
lines changed Original file line number Diff line number Diff line change @@ -1588,18 +1588,12 @@ end
15881588local function findCall (state , position )
15891589 local call
15901590 guide .eachSourceContain (state .ast , position , function (src )
1591- if src .type == ' call' then
1592- if not call or call .start < src .start then
1591+ if src .type == ' call' and src . node . finish <= position then
1592+ if not call or call .start < src .start then
15931593 call = src
15941594 end
15951595 end
15961596 end )
1597- if not call then
1598- return nil
1599- end
1600- if call .node .finish > position then
1601- return nil
1602- end
16031597 return call
16041598end
16051599
Original file line number Diff line number Diff line change @@ -4489,3 +4489,48 @@ local m
44894489m:self(<??>):optional()
44904490]]
44914491(nil )
4492+
4493+ TEST [[
4494+ ---@enum(key) enum
4495+ local t = {
4496+ a = 1,
4497+ b = 2,
4498+ c = 3,
4499+ }
4500+
4501+ ---@class A
4502+ local M
4503+
4504+ ---@return A
4505+ function M.create()
4506+ return M
4507+ end
4508+
4509+ ---@param optional enum
4510+ ---@return self
4511+ function M:optional(optional)
4512+ return self
4513+ end
4514+
4515+ ---@return A
4516+ function M:self()
4517+ return self
4518+ end
4519+
4520+
4521+ M.create():optional(<??>):self()
4522+ ]]
4523+ {
4524+ {
4525+ label = ' "a"' ,
4526+ kind = define .CompletionItemKind .EnumMember ,
4527+ },
4528+ {
4529+ label = ' "b"' ,
4530+ kind = define .CompletionItemKind .EnumMember ,
4531+ },
4532+ {
4533+ label = ' "c"' ,
4534+ kind = define .CompletionItemKind .EnumMember ,
4535+ },
4536+ }
You can’t perform that action at this time.
0 commit comments