forked from VimPlug/jedi
Don't use internal parso APIs if possible
This commit is contained in:
@@ -404,7 +404,7 @@ class Completion(BaseDefinition):
|
|||||||
append = '('
|
append = '('
|
||||||
|
|
||||||
if self._name.api_type == 'param' and self._stack is not None:
|
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:
|
if 'trailer' in nonterminals and 'argument' not in nonterminals:
|
||||||
# TODO this doesn't work for nested calls.
|
# TODO this doesn't work for nested calls.
|
||||||
append += '='
|
append += '='
|
||||||
|
|||||||
@@ -176,9 +176,9 @@ class Completion:
|
|||||||
PythonTokenTypes.INDENT)):
|
PythonTokenTypes.INDENT)):
|
||||||
# This means that we actually have to do type inference.
|
# 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'):
|
if nodes and nodes[-1] in ('as', 'def', 'class'):
|
||||||
# No completions for ``with x as foo`` and ``import x as foo``.
|
# No completions for ``with x as foo`` and ``import x as foo``.
|
||||||
|
|||||||
Reference in New Issue
Block a user