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':
|
||||
types = self.eval_statement(context, element)
|
||||
elif element.type in ('power', 'atom_expr'):
|
||||
types = self._eval_atom(context, element.children[0])
|
||||
for trailer in element.children[1:]:
|
||||
if trailer == '**': # has a power operation.
|
||||
right = self.eval_element(context, element.children[2])
|
||||
types = set(precedence.calculate(self, context, types, trailer, right))
|
||||
break
|
||||
types = self.eval_trailer(context, types, trailer)
|
||||
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])
|
||||
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',):
|
||||
# The implicit tuple in statements.
|
||||
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