Fix a weird AttributeError, fixes #1765

This commit is contained in:
Dave Halter committed 2022-11-13 18:26:01 +01:00
1 parent 85780111e0
commit 6e5db3f479
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -306,7 +306,7 @@ def _iter_arguments(nodes, position):
first = node.children[0] first = node.children[0]
second = node.children[1] second = node.children[1]
if second == '=': if second == '=':
if second.start_pos < position: if second.start_pos < position and first.type == 'name':
yield 0, first.value, True yield 0, first.value, True
else: else:
yield 0, remove_after_pos(first), False yield 0, remove_after_pos(first), False
+1
View File
@@ -650,6 +650,7 @@ def test_cursor_after_signature(Script, column):
('abs(chr ( \nclass y: pass', 1, 8, 'abs', 0), ('abs(chr ( \nclass y: pass', 1, 8, 'abs', 0),
('abs(chr ( \nclass y: pass', 1, 9, 'abs', 0), ('abs(chr ( \nclass y: pass', 1, 9, 'abs', 0),
('abs(chr ( \nclass y: pass', 1, 10, 'chr', 0), ('abs(chr ( \nclass y: pass', 1, 10, 'chr', 0),
('abs(foo.bar=3)', 1, 13, 'abs', 0),
] ]
) )
def test_base_signatures(Script, code, line, column, name, index): def test_base_signatures(Script, code, line, column, name, index):