forked from VimPlug/jedi
Fix await issues. At the moment Jedi is just ignoring await statements.
This commit is contained in:
@@ -280,7 +280,9 @@ 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]
|
||||||
|
if not (first_child.type == 'keyword' and first_child.value == 'await'):
|
||||||
|
types = self._eval_atom(context, first_child)
|
||||||
for trailer in element.children[1:]:
|
for trailer in element.children[1:]:
|
||||||
if trailer == '**': # has a power operation.
|
if trailer == '**': # has a power operation.
|
||||||
right = self.eval_element(context, element.children[2])
|
right = self.eval_element(context, element.children[2])
|
||||||
|
|||||||
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