mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-20 12:31:14 +08:00
Get rid of all names_dicts in the completion api.
This commit is contained in:
@@ -234,11 +234,10 @@ class Completion:
|
||||
if cls.start_pos[1] >= leaf.start_pos[1]:
|
||||
return
|
||||
|
||||
names_dicts = cls.names_dicts(search_global=False, is_instance=True)
|
||||
filters = cls.get_filters(search_global=False, is_instance=True)
|
||||
# The first dict is the dictionary of class itself.
|
||||
next(names_dicts)
|
||||
for names_dict in names_dicts:
|
||||
for values in names_dict.values():
|
||||
for value in values:
|
||||
if (value.parent.type == 'funcdef') == is_function:
|
||||
yield value
|
||||
next(filters)
|
||||
for filter in filters:
|
||||
for name in filter.values():
|
||||
if (name.parent.type == 'funcdef') == is_function:
|
||||
yield name
|
||||
|
||||
@@ -332,8 +332,8 @@ class CompiledObjectFilter(AbstractFilter):
|
||||
"""
|
||||
name_class = CompiledName
|
||||
|
||||
def __init__(self, evaluator, compiled_obj, origin_scope, is_instance=False):
|
||||
super(CompiledObjectFilter, self).__init__(origin_scope)
|
||||
def __init__(self, evaluator, compiled_obj, is_instance=False):
|
||||
super(CompiledObjectFilter, self).__init__(None)
|
||||
self._evaluator = evaluator
|
||||
self._compiled_obj = compiled_obj
|
||||
self._is_instance = is_instance
|
||||
|
||||
@@ -554,10 +554,10 @@ class Class(use_metaclass(CachedMetaClass, Wrapper)):
|
||||
else:
|
||||
for scope in self.py__mro__():
|
||||
if isinstance(scope, compiled.CompiledObject):
|
||||
for filter in scope.get_filters():
|
||||
for filter in scope.get_filters(is_instance=is_instance):
|
||||
yield filter
|
||||
else:
|
||||
yield ParserTreeFilter(self._evaluator, self.base)
|
||||
yield ParserTreeFilter(self._evaluator, scope.base)
|
||||
|
||||
def is_class(self):
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user