1
0
forked from VimPlug/jedi

Apply evaluate.representation wrappers already before they go out into the goto world.

This commit is contained in:
Dave Halter
2014-09-11 02:20:54 +02:00
parent 1624fa0872
commit 085c8034b3
3 changed files with 30 additions and 23 deletions

View File

@@ -186,6 +186,10 @@ class Script(object):
and n.lower().startswith(like.lower()) \
or n.startswith(like):
if not filter_private_variable(s, user_stmt or self._parser.user_scope(), n):
if isinstance(c.parent.parent, (pr.Function, pr.Class)):
# TODO I think this is a hack. It should be an
# er.Function/er.Class before that.
c = er.wrap(self._evaluator, c.parent.parent).name.names[-1]
new = classes.Completion(self._evaluator, c, needs_dot, len(like), s)
k = (new.name, new.complete) # key
if k in comp_dct and settings.no_completion_duplicates:
@@ -378,7 +382,7 @@ class Script(object):
context = self._user_context.get_context()
definitions = set()
if next(context) in ('class', 'def'):
definitions = set([self._parser.user_scope()])
definitions = set([er.wrap(self._evaluator, self._parser.user_scope())])
else:
# Fetch definition of callee, if there's no path otherwise.
if not goto_path: