forked from VimPlug/jedi
Fix a None issue
This commit is contained in:
@@ -343,19 +343,20 @@ class Completion:
|
|||||||
if stack_node.nonterminal == 'funcdef':
|
if stack_node.nonterminal == 'funcdef':
|
||||||
context = get_user_context(self._module_context, self._position)
|
context = get_user_context(self._module_context, self._position)
|
||||||
node = search_ancestor(leaf, 'error_node', 'funcdef')
|
node = search_ancestor(leaf, 'error_node', 'funcdef')
|
||||||
if node.type == 'error_node':
|
if node is not None:
|
||||||
n = node.children[0]
|
if node.type == 'error_node':
|
||||||
if n.type == 'decorators':
|
n = node.children[0]
|
||||||
decorators = n.children
|
if n.type == 'decorators':
|
||||||
elif n.type == 'decorator':
|
decorators = n.children
|
||||||
decorators = [n]
|
elif n.type == 'decorator':
|
||||||
|
decorators = [n]
|
||||||
|
else:
|
||||||
|
decorators = []
|
||||||
else:
|
else:
|
||||||
decorators = []
|
decorators = node.get_decorators()
|
||||||
else:
|
function_name = stack_node.nodes[1]
|
||||||
decorators = node.get_decorators()
|
|
||||||
function_name = stack_node.nodes[1]
|
|
||||||
|
|
||||||
return complete_param_names(context, function_name.value, decorators)
|
return complete_param_names(context, function_name.value, decorators)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def _complete_keywords(self, allowed_transitions, only_values):
|
def _complete_keywords(self, allowed_transitions, only_values):
|
||||||
|
|||||||
Reference in New Issue
Block a user