mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-25 05:07:12 +08:00
Fix all the normal issues with the NameFinder change. Now goto...
This commit is contained in:
@@ -103,7 +103,6 @@ class NameFinder(object):
|
||||
or isinstance(stmt, pr.ExprStmt) and stmt.is_global():
|
||||
# Always reachable.
|
||||
result.append(name.names[-1])
|
||||
assert name == name.names[-1].parent
|
||||
else:
|
||||
check = flow_analysis.break_check(self._evaluator,
|
||||
name_list_scope,
|
||||
@@ -269,7 +268,7 @@ class NameFinder(object):
|
||||
p = stmt.parent
|
||||
# TODO this looks really hacky, improve parser representation!
|
||||
if isinstance(p, pr.Flow) and p.command == 'except' \
|
||||
and p.inputs and p.inputs[0].as_names == [name]:
|
||||
and p.inputs and p.inputs[0].as_names[0].names[-1] == name:
|
||||
# TODO check for types that are not classes and add it to the
|
||||
# static analysis report.
|
||||
types = list(chain.from_iterable(
|
||||
|
||||
@@ -234,10 +234,14 @@ class ArrayMethod(IterableWrapper):
|
||||
super(ArrayMethod, self).__init__()
|
||||
self.name = name
|
||||
|
||||
@property
|
||||
@underscore_memoization
|
||||
def names(self):
|
||||
return [pr.NamePart(unicode(n), self, n.start_pos) for n in self.name.names]
|
||||
|
||||
def __getattr__(self, name):
|
||||
# Set access privileges:
|
||||
if name not in ['parent', 'names', 'start_pos', 'end_pos', 'get_code',
|
||||
'get_definition']:
|
||||
if name not in ['parent', 'start_pos', 'end_pos', 'get_code', 'get_definition']:
|
||||
raise AttributeError('Strange access on %s: %s.' % (self, name))
|
||||
return getattr(self.name, name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user