From 1428b67c4d315c5b7136a1a98c6a832068eb4525 Mon Sep 17 00:00:00 2001 From: langsamer <25152973+langsamer@users.noreply.github.com> Date: Sun, 29 Oct 2017 02:00:28 +0200 Subject: [PATCH] Replace TODO by explanation of the parameter 'cut_own_trailer' (it cannot be dropped!) (#978) --- jedi/evaluate/helpers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jedi/evaluate/helpers.py b/jedi/evaluate/helpers.py index 44522f8b..3b21e01b 100644 --- a/jedi/evaluate/helpers.py +++ b/jedi/evaluate/helpers.py @@ -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