forked from VimPlug/jedi
Fix await issues. At the moment Jedi is just ignoring await statements.
This commit is contained in:
@@ -280,13 +280,15 @@ class Evaluator(object):
|
|||||||
elif element.type == 'expr_stmt':
|
elif element.type == 'expr_stmt':
|
||||||
types = self.eval_statement(context, element)
|
types = self.eval_statement(context, element)
|
||||||
elif element.type in ('power', 'atom_expr'):
|
elif element.type in ('power', 'atom_expr'):
|
||||||
types = self._eval_atom(context, element.children[0])
|
first_child = element.children[0]
|
||||||
for trailer in element.children[1:]:
|
if not (first_child.type == 'keyword' and first_child.value == 'await'):
|
||||||
if trailer == '**': # has a power operation.
|
types = self._eval_atom(context, first_child)
|
||||||
right = self.eval_element(context, element.children[2])
|
for trailer in element.children[1:]:
|
||||||
types = set(precedence.calculate(self, context, types, trailer, right))
|
if trailer == '**': # has a power operation.
|
||||||
break
|
right = self.eval_element(context, element.children[2])
|
||||||
types = self.eval_trailer(context, types, trailer)
|
types = set(precedence.calculate(self, context, types, trailer, right))
|
||||||
|
break
|
||||||
|
types = self.eval_trailer(context, types, trailer)
|
||||||
elif element.type in ('testlist_star_expr', 'testlist',):
|
elif element.type in ('testlist_star_expr', 'testlist',):
|
||||||
# The implicit tuple in statements.
|
# The implicit tuple in statements.
|
||||||
types = set([iterable.SequenceLiteralContext(self, context, element)])
|
types = set([iterable.SequenceLiteralContext(self, context, element)])
|
||||||
|
|||||||
19
test/completion/async_.py
Normal file
19
test/completion/async_.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
"""
|
||||||
|
Tests for all async use cases.
|
||||||
|
|
||||||
|
Currently we're not supporting completion of them, but they should at least not
|
||||||
|
raise errors or return strange results.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
async def x():
|
||||||
|
await 3
|
||||||
|
|
||||||
|
#?
|
||||||
|
x()
|
||||||
|
|
||||||
|
a = await x()
|
||||||
|
#?
|
||||||
|
a
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user