Fix REPL completion param name completion

There were two issues:
1. The filter for parameters was wrong
2. In general the equal sign would not be added in some circumstances
This commit is contained in:
Dave Halter
2018-03-13 21:36:04 +01:00
parent 0dda740c5d
commit f9ec989835
4 changed files with 22 additions and 15 deletions

View File

@@ -406,7 +406,7 @@ class Completion(BaseDefinition):
and self.type == 'Function':
append = '('
if isinstance(self._name, ParamName) and self._stack is not None:
if self._name.api_type == 'param' and self._stack is not None:
node_names = list(self._stack.get_node_names(self._evaluator.grammar._pgen_grammar))
if 'trailer' in node_names and 'argument' not in node_names:
append += '='