mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Fix a weird AttributeError, fixes #1765
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user