1
0
forked from VimPlug/jedi

Fix issue around completions with multiple with with_items, fixes 1931

This commit is contained in:
Dave Halter
2023-07-27 11:54:39 +02:00
parent cd4ca74d7a
commit 6ea5ad7b19
2 changed files with 8 additions and 0 deletions

View File

@@ -402,6 +402,10 @@ def find_type_from_comment_hint_for(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, \
"Can only be here when children[1] is 'foo() as f'"
varlist = node.children[1].children[2]

View File

@@ -413,6 +413,10 @@ with Foo() as f3:
with Foo() as f3:
f3
with open("a"), open("b") as bfile:
#? ['flush']
bfile.flush
# -----------------
# Avoiding multiple definitions
# -----------------