mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Get all tests working except usage tests
This commit is contained in:
@@ -109,7 +109,6 @@ class Completion:
|
|||||||
self._like_name, self._call_signatures_callback,
|
self._like_name, self._call_signatures_callback,
|
||||||
self._code_lines, self._original_position
|
self._code_lines, self._original_position
|
||||||
))
|
))
|
||||||
return completions
|
|
||||||
if completions:
|
if completions:
|
||||||
return completions
|
return completions
|
||||||
|
|
||||||
|
|||||||
@@ -192,3 +192,6 @@ class CompiledContext(AbstractContext):
|
|||||||
|
|
||||||
def get_value(self):
|
def get_value(self):
|
||||||
return self._value
|
return self._value
|
||||||
|
|
||||||
|
def py__file__(self):
|
||||||
|
return self._value.py__file__()
|
||||||
|
|||||||
@@ -432,15 +432,16 @@ class SelfName(TreeNameDefinition):
|
|||||||
|
|
||||||
|
|
||||||
class LazyInstanceClassName(object):
|
class LazyInstanceClassName(object):
|
||||||
def __init__(self, instance, class_value, class_member_name):
|
def __init__(self, instance, class_context, class_member_name):
|
||||||
self._instance = instance
|
self._instance = instance
|
||||||
self.class_value = class_value
|
self.class_context = class_context
|
||||||
self._class_member_name = class_member_name
|
self._class_member_name = class_member_name
|
||||||
|
|
||||||
@iterator_to_value_set
|
@iterator_to_value_set
|
||||||
def infer(self):
|
def infer(self):
|
||||||
for result_value in self._class_member_name.infer():
|
for result_value in self._class_member_name.infer():
|
||||||
for c in apply_py__get__(result_value, self._instance, self.class_value):
|
# TODO private access!
|
||||||
|
for c in apply_py__get__(result_value, self._instance, self.class_context._value):
|
||||||
yield c
|
yield c
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ class ClassName(TreeNameDefinition):
|
|||||||
if self._apply_decorators:
|
if self._apply_decorators:
|
||||||
for c in apply_py__get__(result_value,
|
for c in apply_py__get__(result_value,
|
||||||
instance=None,
|
instance=None,
|
||||||
class_value=self.parent_context):
|
# TODO private access!
|
||||||
|
class_value=self.parent_context._value):
|
||||||
yield c
|
yield c
|
||||||
else:
|
else:
|
||||||
yield result_value
|
yield result_value
|
||||||
@@ -205,7 +206,7 @@ class ClassMixin(object):
|
|||||||
yield filter
|
yield filter
|
||||||
else:
|
else:
|
||||||
yield ClassFilter(
|
yield ClassFilter(
|
||||||
self, node_context=cls.as_context(),
|
self.as_context(), node_context=cls.as_context(),
|
||||||
origin_scope=origin_scope,
|
origin_scope=origin_scope,
|
||||||
is_instance=is_instance
|
is_instance=is_instance
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -583,7 +583,7 @@ class DataclassWrapper(ValueWrapper, ClassMixin):
|
|||||||
param_names = []
|
param_names = []
|
||||||
for cls in reversed(list(self.py__mro__())):
|
for cls in reversed(list(self.py__mro__())):
|
||||||
if isinstance(cls, DataclassWrapper):
|
if isinstance(cls, DataclassWrapper):
|
||||||
filter_ = cls.get_global_filter()
|
filter_ = cls.as_context().get_global_filter()
|
||||||
# .values ordering is not guaranteed, at least not in
|
# .values ordering is not guaranteed, at least not in
|
||||||
# Python < 3.6, when dicts where not ordered, which is an
|
# Python < 3.6, when dicts where not ordered, which is an
|
||||||
# implementation detail anyway.
|
# implementation detail anyway.
|
||||||
|
|||||||
Reference in New Issue
Block a user