def _analysis(self): self._evaluator.is_analysis = True module_node = self._get_module_node() self._evaluator.analysis_modules = [module_node] try: for node in get_executable_nodes(module_node): context = self._get_module().create_context(node) if node.type in ('funcdef', 'classdef'): # TODO This is stupid, should be private from jedi.evaluate.finder import _name_to_types # Resolve the decorators. _name_to_types(self._evaluator, context, node.children[1]) elif isinstance(node, tree.Import): import_names = set(node.get_defined_names()) if node.is_nested(): import_names |= set(path[-1] for path in node.get_paths()) for n in import_names: imports.infer_import(context, n) elif node.type == 'expr_stmt': types = context.eval_node(node) for testlist in node.children[:-1:2]: # Iterate tuples. unpack_tuple_to_dict(context, types, testlist) else: try_iter_content(self._evaluator.goto_definitions(context, node)) self._evaluator.reset_recursion_limitations() ana = [a for a in self._evaluator.analysis if self.path == a.path] return sorted(set(ana), key=lambda x: x.line) finally: self._evaluator.is_analysis = False
def infer(self): # TODO this _name_to_types might get refactored and be a part of the # parent class. Once it is, we can probably just overwrite method to # achieve this. from jedi.evaluate.finder import _name_to_types inferred = _name_to_types( self.parent_context.evaluator, self._name_context, self.tree_name) for result_context in inferred: for c in apply_py__get__(result_context, self.parent_context): yield c
def infer(self): # TODO this _name_to_types might get refactored and be a part of the # parent class. Once it is, we can probably just overwrite method to # achieve this. from jedi.evaluate.finder import _name_to_types inferred = _name_to_types(self.parent_context.evaluator, self._name_context, self.tree_name) for result_context in inferred: for c in apply_py__get__(result_context, self.parent_context): yield c
def infer(self): # Refactor this, should probably be here. from jedi.evaluate.finder import _name_to_types return _name_to_types(self.parent_context.evaluator, self.parent_context, self.tree_name)
def infer(self): # Refactor this, should probably be here. from jedi.evaluate.finder import _name_to_types return _name_to_types(self.parent_context.evaluator, self.parent_context, self.tree_name)