Skip to content

Commit d777c2b

Browse files
Avishayymfussenegger
authored andcommitted
1 parent ae0225d commit d777c2b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lua/dap-python.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,12 @@ function M._get_nodes(source, subject, end_row)
351351
local parent = result
352352
while parent ~= nil do
353353
if parent:type() == "function_definition" then
354-
local ident = parent:child(1)
355-
assert(ident:type() == "identifier")
354+
local ident
355+
if parent:child(1):type() == "identifier" then
356+
ident = parent:child(1)
357+
elseif parent:child(2) and parent:child(2):type() == "identifier" then
358+
ident = parent:child(2)
359+
end
356360
result = ident
357361
end
358362
parent = parent:parent()

0 commit comments

Comments
 (0)