1
0
forked from VimPlug/jedi

Move all the search to py__getattribute__ and remove find_types.

This commit is contained in:
Dave Halter
2017-09-27 19:22:50 +02:00
parent 9073f0debc
commit 0782a80cef
2 changed files with 19 additions and 21 deletions

View File

@@ -50,8 +50,21 @@ class Context(object):
def py__getattribute__(self, name_or_str, name_context=None, position=None,
search_global=False, is_goto=False,
analysis_errors=True):
"""
This is the search function.
:param position: Position of the last statement -> tuple of line, column
"""
if name_context is None:
name_context = self
from jedi.evaluate import finder
f = finder.NameFinder(self.evaluator, self, name_context, name_or_str,
position, analysis_errors=analysis_errors)
filters = f.get_filters(search_global)
if is_goto:
return f.filter_name(filters)
return f.find(filters, attribute_lookup=not search_global)
return self.evaluator.find_types(
self, name_or_str, name_context, position, search_global, is_goto,
analysis_errors)