forked from VimPlug/jedi
Fix issue around completions with multiple with with_items, fixes 1931
This commit is contained in:
@@ -402,6 +402,10 @@ def find_type_from_comment_hint_for(context, node, name):
|
|||||||
|
|
||||||
|
|
||||||
def find_type_from_comment_hint_with(context, node, name):
|
def find_type_from_comment_hint_with(context, node, name):
|
||||||
|
if len(node.children) > 4:
|
||||||
|
# In case there are multiple with_items, we do not want a type hint for
|
||||||
|
# now.
|
||||||
|
return []
|
||||||
assert len(node.children[1].children) == 3, \
|
assert len(node.children[1].children) == 3, \
|
||||||
"Can only be here when children[1] is 'foo() as f'"
|
"Can only be here when children[1] is 'foo() as f'"
|
||||||
varlist = node.children[1].children[2]
|
varlist = node.children[1].children[2]
|
||||||
|
|||||||
@@ -413,6 +413,10 @@ with Foo() as f3:
|
|||||||
with Foo() as f3:
|
with Foo() as f3:
|
||||||
f3
|
f3
|
||||||
|
|
||||||
|
with open("a"), open("b") as bfile:
|
||||||
|
#? ['flush']
|
||||||
|
bfile.flush
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# Avoiding multiple definitions
|
# Avoiding multiple definitions
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user