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)
cls = tree.search_ancestor(leaf, 'classdef')
if isinstance(cls, (tree.Class, tree.Function)):
# Complete the methods that are defined in the super classes.
random_context = self._module_context.create_context(
cls,
node_is_value=True
)
else:
if cls is None:
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]:
return
# 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.
next(filters)
for filter in filters: