1
0
forked from VimPlug/jedi

Small cleanup of code

This commit is contained in:
Dave Halter
2019-08-22 17:20:07 +02:00
parent f87f8c028b
commit eee6810576

View File

@@ -282,20 +282,17 @@ class Completion:
""" """
leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True)
cls = tree.search_ancestor(leaf, 'classdef') cls = tree.search_ancestor(leaf, 'classdef')
if isinstance(cls, (tree.Class, tree.Function)): if cls is None:
# Complete the methods that are defined in the super classes.
random_context = self._module_context.create_context(
cls,
node_is_value=True
)
else:
return return
# Complete the methods that are defined in the super classes.
class_context = self._module_context.create_context(cls, node_is_value=True)
if cls.start_pos[1] >= leaf.start_pos[1]: if cls.start_pos[1] >= leaf.start_pos[1]:
return return
# TODO _value private access! # TODO _value private access!
filters = random_context._value.get_filters(is_instance=True) filters = class_context._value.get_filters(is_instance=True)
# The first dict is the dictionary of class itself. # The first dict is the dictionary of class itself.
next(filters) next(filters)
for filter in filters: for filter in filters: