diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index 9ccee5a0..52ccf01d 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -208,32 +208,12 @@ class Script(object): :return: Completion objects, sorted by name and __ comes last. :rtype: list of :class:`classes.Completion` """ - debug.speed('completions start') - completion = Completion( - self._evaluator, self._get_module(), self._code_lines, - self._pos, self.call_signatures - ) - completions = completion.completions() - - def iter_import_completions(): - for c in completions: - tree_name = c._name.tree_name - if tree_name is None: - continue - definition = tree_name.get_definition() - if definition is not None \ - and definition.type in ('import_name', 'import_from'): - yield c - - if len(list(iter_import_completions())) > 10: - # For now disable completions if there's a lot of imports that - # might potentially be resolved. This is the case for tensorflow - # and has been fixed for it. This is obviously temporary until we - # have a better solution. - self._evaluator.infer_enabled = False - - debug.speed('completions end') - return completions + with debug.increase_indent_cm('completions'): + completion = Completion( + self._evaluator, self._get_module(), self._code_lines, + self._pos, self.call_signatures + ) + return completion.completions() def goto_definitions(self, **kwargs): """ diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index b8110385..2ad747ee 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -115,9 +115,6 @@ class Evaluator(object): self.is_analysis = False self.project = project self.access_cache = {} - # This setting is only temporary to limit the work we have to do with - # tensorflow and others. - self.infer_enabled = True self.reset_recursion_limitations() self.allow_different_encoding = True @@ -165,9 +162,6 @@ class Evaluator(object): return self.project._get_sys_path(self, environment=self.environment, **kwargs) def eval_element(self, context, element): - if not self.infer_enabled: - return NO_CONTEXTS - if isinstance(context, CompForContext): return eval_node(context, element) diff --git a/jedi/evaluate/imports.py b/jedi/evaluate/imports.py index cbe65a8e..fadfe5f4 100644 --- a/jedi/evaluate/imports.py +++ b/jedi/evaluate/imports.py @@ -277,8 +277,7 @@ class Importer(object): return sys_path_mod def follow(self): - if not self.import_path or not self._evaluator.infer_enabled \ - or not self._inference_possible: + if not self.import_path or not self._inference_possible: return NO_CONTEXTS import_names = tuple(