1
0
forked from VimPlug/jedi

Fix the last known case of call signatures. Yay!

This commit is contained in:
Dave Halter
2016-06-20 18:32:44 +02:00
parent e0631cfda2
commit 5212849780
2 changed files with 3 additions and 1 deletions

View File

@@ -223,7 +223,7 @@ def _get_call_signature_details_from_error_node(node, position):
# until the parentheses is enough. # until the parentheses is enough.
children = node.children[index:] children = node.children[index:]
name = element.get_previous_leaf() name = element.get_previous_leaf()
if name.type == 'name' or name.parent.type == 'trailer': if name.type == 'name' or name.parent.type in ('trailer', 'atom'):
return CallSignatureDetails( return CallSignatureDetails(
element, element,
*_get_index_and_key(children, position) *_get_index_and_key(children, position)

View File

@@ -80,6 +80,8 @@ def call_of_name(name, cut_own_trailer=False):
# TODO remove cut_own_trailer option, since its always used with it. Just # TODO remove cut_own_trailer option, since its always used with it. Just
# ignore it, It's not what we want anyway. Or document it better? # ignore it, It's not what we want anyway. Or document it better?
# TODO rename this function, it's probably better called `call_of_leaf`,
# since it can also be used for closing parentheses?!
""" """
trailer = name.parent trailer = name.parent
if trailer.type != 'trailer': if trailer.type != 'trailer':