1
0
forked from VimPlug/jedi

Fix await issues. At the moment Jedi is just ignoring await statements.

This commit is contained in:
Dave Halter
2017-01-07 15:27:20 +01:00
parent d3c437e891
commit 6a18ddf8cb
2 changed files with 28 additions and 7 deletions

View File

@@ -280,7 +280,9 @@ class Evaluator(object):
elif element.type == 'expr_stmt':
types = self.eval_statement(context, element)
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:]:
if trailer == '**': # has a power operation.
right = self.eval_element(context, element.children[2])

19
test/completion/async_.py Normal file
View 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