forked from VimPlug/jedi
fixed the position problems, that came with the last big patch
This commit is contained in:
16
evaluate.py
16
evaluate.py
@@ -647,14 +647,14 @@ class Generator(object):
|
|||||||
content of a generator.
|
content of a generator.
|
||||||
"""
|
"""
|
||||||
names = []
|
names = []
|
||||||
for n in ['__next__', 'send']:
|
none_pos = (None,None)
|
||||||
# The name for the `next` function.
|
executes_generator = ('__next__', 'send')
|
||||||
name = parsing.Name([n], 0, 0, 0)
|
for n in ('close', 'throw') + executes_generator:
|
||||||
name.parent = self
|
name = parsing.Name([n], none_pos, none_pos)
|
||||||
names.append(name)
|
if n in executes_generator:
|
||||||
for n in ['close', 'throw']:
|
name.parent = self
|
||||||
name = parsing.Name([n], 0, 0, 0)
|
else:
|
||||||
name.parent = None
|
name.parent = None
|
||||||
names.append(name)
|
names.append(name)
|
||||||
debug.dbg('generator names', names)
|
debug.dbg('generator names', names)
|
||||||
return names
|
return names
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class Definition(object):
|
|||||||
return path
|
return path
|
||||||
|
|
||||||
def get_line(self):
|
def get_line(self):
|
||||||
return self.scope.line_nr
|
return self.scope.start_pos[0]
|
||||||
|
|
||||||
def get_indent(self):
|
def get_indent(self):
|
||||||
return self.scope.indent
|
return self.scope.indent
|
||||||
@@ -194,8 +194,7 @@ def prepare_goto(source, position, source_path, is_like_search):
|
|||||||
path_tuple = ()
|
path_tuple = ()
|
||||||
raise NotFoundError(scope, path_tuple)
|
raise NotFoundError(scope, path_tuple)
|
||||||
else:
|
else:
|
||||||
stmt.line_nr = position[0]
|
stmt.start_pos = position
|
||||||
stmt.indent = position[1]
|
|
||||||
stmt.parent = scope
|
stmt.parent = scope
|
||||||
scopes = evaluate.follow_statement(stmt)
|
scopes = evaluate.follow_statement(stmt)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user