1
0
forked from VimPlug/jedi

Trying to move towards unifying goto and py__getattribute__

This commit is contained in:
Dave Halter
2019-08-24 00:18:48 +02:00
parent fcec30dff6
commit b13a9f7d5b
4 changed files with 18 additions and 23 deletions

View File

@@ -46,12 +46,11 @@ class NameFinder(object):
self._found_predefined_types = None
self._analysis_errors = analysis_errors
def find(self, filters, attribute_lookup):
def find(self, names, attribute_lookup):
"""
:params bool attribute_lookup: Tell to logic if we're accessing the
attribute or the contents of e.g. a function.
"""
names = self.filter_name(filters)
if self._found_predefined_types is not None and names:
check = flow_analysis.reachability_check(
context=self._context,
@@ -63,7 +62,10 @@ class NameFinder(object):
return self._found_predefined_types
types = self._names_to_types(names)
self.check_issues(names, types, attribute_lookup)
return types
def check_issues(self, names, types, attribute_lookup):
if not names and self._analysis_errors and not types \
and not (isinstance(self._name, tree.Name) and
isinstance(self._name.parent.parent, tree.Param)):
@@ -76,8 +78,6 @@ class NameFinder(object):
% self._string_name)
analysis.add(self._name_context, 'name-error', self._name, message)
return types
def filter_name(self, filters):
"""
Searches names that are defined in a scope (the different