forked from VimPlug/jedi
Fixed another diff parser error.
This commit is contained in:
@@ -437,11 +437,17 @@ class _NodesStackNode(object):
|
|||||||
def get_last_line(self, suffix):
|
def get_last_line(self, suffix):
|
||||||
line = 0
|
line = 0
|
||||||
if self.children_groups:
|
if self.children_groups:
|
||||||
last_leaf = self.children_groups[-1].children[-1].get_last_leaf()
|
children_group = self.children_groups[-1]
|
||||||
|
last_leaf = children_group.children[-1].get_last_leaf()
|
||||||
line = last_leaf.end_pos[0]
|
line = last_leaf.end_pos[0]
|
||||||
|
|
||||||
# Calculate the line offsets
|
# Calculate the line offsets
|
||||||
line += self.children_groups[-1].line_offset
|
offset = children_group.line_offset
|
||||||
|
if offset:
|
||||||
|
# In case the line_offset is not applied to this specific leaf,
|
||||||
|
# just ignore it.
|
||||||
|
if last_leaf.line <= children_group.last_line_offset_leaf.line:
|
||||||
|
line += children_group.line_offset
|
||||||
|
|
||||||
# Newlines end on the next line, which means that they would cover
|
# Newlines end on the next line, which means that they would cover
|
||||||
# the next line. That line is not fully parsed at this point.
|
# the next line. That line is not fully parsed at this point.
|
||||||
|
|||||||
@@ -488,12 +488,6 @@ def test_in_parentheses_newlines(differ):
|
|||||||
b = 2""")
|
b = 2""")
|
||||||
|
|
||||||
|
|
||||||
script = jedi.Script(code1, line=2, column=8)
|
|
||||||
assert script.call_signatures()
|
|
||||||
script = jedi.Script(code2, line=2, column=9)
|
|
||||||
assert script.call_signatures()
|
|
||||||
script = jedi.Script(code1, line=2, column=8)
|
|
||||||
assert script.call_signatures()
|
|
||||||
differ.initialize(code1)
|
differ.initialize(code1)
|
||||||
differ.parse(code2, parsers=1, copies=1)
|
differ.parse(code2, parsers=2, copies=1)
|
||||||
differ.parse(code1, parsers=1, copies=1)
|
differ.parse(code1, parsers=2, copies=1)
|
||||||
|
|||||||
Reference in New Issue
Block a user