mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-19 06:49:38 +08:00
Small refactoring
This commit is contained in:
@@ -14,13 +14,6 @@ class _StubContextMixin(object):
|
|||||||
def is_stub(self):
|
def is_stub(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _get_stub_filters(self, **filter_kwargs):
|
|
||||||
return [StubFilter(
|
|
||||||
self.evaluator,
|
|
||||||
context=self,
|
|
||||||
**filter_kwargs
|
|
||||||
)]
|
|
||||||
|
|
||||||
|
|
||||||
class StubModuleContext(_StubContextMixin, ModuleContext):
|
class StubModuleContext(_StubContextMixin, ModuleContext):
|
||||||
def __init__(self, non_stub_context_set, *args, **kwargs):
|
def __init__(self, non_stub_context_set, *args, **kwargs):
|
||||||
@@ -32,11 +25,12 @@ class StubModuleContext(_StubContextMixin, ModuleContext):
|
|||||||
yield next(context.get_filters(search_global=False))
|
yield next(context.get_filters(search_global=False))
|
||||||
|
|
||||||
def _get_stub_filters(self, search_global, **filter_kwargs):
|
def _get_stub_filters(self, search_global, **filter_kwargs):
|
||||||
stub_filters = super(StubModuleContext, self)._get_stub_filters(
|
return [StubFilter(
|
||||||
search_global=search_global, **filter_kwargs
|
self.evaluator,
|
||||||
)
|
context=self,
|
||||||
stub_filters += self.iter_star_filters(search_global=search_global)
|
search_global=search_global,
|
||||||
return stub_filters
|
**filter_kwargs
|
||||||
|
)] + list(self.iter_star_filters(search_global=search_global))
|
||||||
|
|
||||||
def get_filters(self, search_global=False, until_position=None,
|
def get_filters(self, search_global=False, until_position=None,
|
||||||
origin_scope=None, **kwargs):
|
origin_scope=None, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user