(self, is_function=True)
Autocomplete inherited methods when overriding in child class.
Autocomplete inherited methods when overriding in child class.
Autocomplete inherited methods when overriding in child class .
def _get_class_context_completions(self, is_function=True):
        """
        Autocomplete inherited methods when overriding in child class.
        """
        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_context=True
            )
        else:
            return

        if cls.start_pos[1] >= leaf.start_pos[1]:
            return

        filters = random_context.get_filters(search_global=False, is_instance=True)
        # The first dict is the dictionary of class itself.
        next(filters)
        for filter in filters:
            for name in filter.values():
                if (name.api_type == 'function') == is_function:
                    yield name
def _get_class_context_completions ( self , is_function = True ) : 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_context = True ) else : return if cls . start_pos [ 1 ] >= leaf . start_pos [ 1 ] : return filters = random_context . get_filters ( search_global = False , is_instance = True ) # The first dict is the dictionary of class itself. next ( filters ) for filter in filters : for name in filter . values ( ) : if ( name . api_type == 'function' ) == is_function : yield name