mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-17 20:04:13 +08:00
Remove IsScope in favor of an is_scope function.
This function was partially implemented anway. Now we've also added a function called 'get_parent_scope', to make it easy to get a scope of a Call, Statement, whatever.
This commit is contained in:
@@ -220,9 +220,10 @@ class Evaluator(object):
|
||||
"""Follow a call is following a function, variable, string, etc."""
|
||||
path = call.generate_call_path()
|
||||
|
||||
# TODO use scope_parent
|
||||
# find the statement of the Scope
|
||||
s = call
|
||||
while not s.parent.isinstance(pr.IsScope):
|
||||
while not s.parent.is_scope():
|
||||
s = s.parent
|
||||
par = s.parent
|
||||
return self.eval_call_path(path, par, s.start_pos)
|
||||
@@ -335,7 +336,7 @@ class Evaluator(object):
|
||||
return types
|
||||
|
||||
def goto(self, stmt, call_path):
|
||||
scope = stmt.get_parent_until(pr.IsScope)
|
||||
scope = stmt.get_parent_scope()
|
||||
pos = stmt.start_pos
|
||||
call_path, search_name_part = call_path[:-1], call_path[-1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user