mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-26 05:27:16 +08:00
move flowscope stuff to the right place
This commit is contained in:
@@ -444,7 +444,7 @@ class Evaluator(object):
|
|||||||
follow_res = []
|
follow_res = []
|
||||||
for s in scopes:
|
for s in scopes:
|
||||||
follow_res += self.find_types(s, search, pos,
|
follow_res += self.find_types(s, search, pos,
|
||||||
search_global=search_global, is_goto=True)
|
search_global=search_global, is_goto=True)
|
||||||
return follow_res, search
|
return follow_res, search
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -231,24 +231,23 @@ class NameFinder(object):
|
|||||||
if not name.parent or p == s:
|
if not name.parent or p == s:
|
||||||
break
|
break
|
||||||
break_scopes.append(p)
|
break_scopes.append(p)
|
||||||
|
|
||||||
while flow_scope:
|
|
||||||
# TODO check if result is in scope -> no evaluation necessary
|
|
||||||
n = dynamic.check_flow_information(self._evaluator, flow_scope,
|
|
||||||
self.name_str, self.position)
|
|
||||||
if n:
|
|
||||||
result = n
|
|
||||||
break
|
|
||||||
|
|
||||||
if result:
|
|
||||||
break
|
|
||||||
if flow_scope == nscope:
|
|
||||||
break
|
|
||||||
flow_scope = flow_scope.parent
|
|
||||||
flow_scope = nscope
|
|
||||||
if result:
|
if result:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
while flow_scope:
|
||||||
|
# TODO check if result is in scope -> no evaluation necessary
|
||||||
|
n = dynamic.check_flow_information(self._evaluator, flow_scope,
|
||||||
|
self.name_str, self.position)
|
||||||
|
if n:
|
||||||
|
result = n
|
||||||
|
break
|
||||||
|
|
||||||
|
if result:
|
||||||
|
break
|
||||||
|
if flow_scope == nscope:
|
||||||
|
break
|
||||||
|
flow_scope = flow_scope.parent
|
||||||
|
|
||||||
if not result and isinstance(nscope, er.Instance):
|
if not result and isinstance(nscope, er.Instance):
|
||||||
# __getattr__ / __getattribute__
|
# __getattr__ / __getattribute__
|
||||||
result += self._check_getattr(nscope)
|
result += self._check_getattr(nscope)
|
||||||
@@ -258,7 +257,6 @@ class NameFinder(object):
|
|||||||
|
|
||||||
def find(self, scopes, resolve_decorator=True):
|
def find(self, scopes, resolve_decorator=True):
|
||||||
filtered = self.filter_name(scopes)
|
filtered = self.filter_name(scopes)
|
||||||
#print 'f', filtered
|
|
||||||
return self._resolve_descriptors(self._remove_statements(filtered,
|
return self._resolve_descriptors(self._remove_statements(filtered,
|
||||||
resolve_decorator))
|
resolve_decorator))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user