From 68974aee5804aff5966869e3630c164b210cfcf1 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 29 Jun 2018 10:04:03 +0200 Subject: [PATCH] Don't use internal parso APIs if possible --- jedi/api/classes.py | 2 +- jedi/api/completion.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jedi/api/classes.py b/jedi/api/classes.py index 633e8e3d..4168f6e9 100644 --- a/jedi/api/classes.py +++ b/jedi/api/classes.py @@ -404,7 +404,7 @@ class Completion(BaseDefinition): append = '(' if self._name.api_type == 'param' and self._stack is not None: - nonterminals = list(self._stack._list_nonterminals()) + nonterminals = [stack_node.nonterminal for stack_node in self._stack] if 'trailer' in nonterminals and 'argument' not in nonterminals: # TODO this doesn't work for nested calls. append += '=' diff --git a/jedi/api/completion.py b/jedi/api/completion.py index 4b078d4c..358d726b 100644 --- a/jedi/api/completion.py +++ b/jedi/api/completion.py @@ -176,9 +176,9 @@ class Completion: PythonTokenTypes.INDENT)): # This means that we actually have to do type inference. - nonterminals = stack._list_nonterminals() + nonterminals = [stack_node.nonterminal for stack_node in stack] - nodes = stack._list_all_nodes() + nodes = [node for stack_node in stack for node in stack_node.nodes] if nodes and nodes[-1] in ('as', 'def', 'class'): # No completions for ``with x as foo`` and ``import x as foo``.