1
0
forked from VimPlug/jedi

Merge branch 'master' into virtualenv

This commit is contained in:
Dave Halter
2017-12-18 01:41:29 +01:00
13 changed files with 47 additions and 12 deletions

View File

@@ -58,8 +58,11 @@ def evaluate_call_of_leaf(context, leaf, cut_own_trailer=False):
If you're using the leaf, e.g. the bracket `)` it will return ``list([])``.
# TODO remove cut_own_trailer option, since its always used with it. Just
# ignore it, It's not what we want anyway. Or document it better?
We use this function for two purposes. Given an expression ``bar.foo``,
we may want to
- infer the type of ``foo`` to offer completions after foo
- infer the type of ``bar`` to be able to jump to the definition of foo
The option ``cut_own_trailer`` must be set to true for the second purpose.
"""
trailer = leaf.parent
# The leaf may not be the last or first child, because there exist three
@@ -89,6 +92,10 @@ def evaluate_call_of_leaf(context, leaf, cut_own_trailer=False):
base = power.children[0]
trailers = power.children[1:cut]
if base == 'await':
base = trailers[0]
trailers = trailers[1:]
values = context.eval_node(base)
from jedi.evaluate.syntax_tree import eval_trailer
for trailer in trailers: