mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
Fixed issues with last positions in the tokenizer, which was messed up a little bit a few commits ago.
This commit is contained in:
@@ -282,7 +282,9 @@ def generate_tokens(readline):
|
|||||||
paren_level -= 1
|
paren_level -= 1
|
||||||
yield OP, token, spos, prefix
|
yield OP, token, spos, prefix
|
||||||
|
|
||||||
|
end_pos = (lnum, max - 1)
|
||||||
|
# As the last position we just take the maximally possible position. We
|
||||||
|
# remove -1 for the last new line.
|
||||||
for indent in indents[1:]:
|
for indent in indents[1:]:
|
||||||
yield DEDENT, '', (lnum, max), ''
|
yield DEDENT, '', end_pos, ''
|
||||||
# As the last position we just take the max possible.
|
yield ENDMARKER, '', end_pos, prefix
|
||||||
yield ENDMARKER, '', (lnum, max), prefix
|
|
||||||
|
|||||||
@@ -430,11 +430,11 @@ def test_incomplete_function():
|
|||||||
def test_string_literals():
|
def test_string_literals():
|
||||||
"""Simplified case of jedi-vim#377."""
|
"""Simplified case of jedi-vim#377."""
|
||||||
source = dedent("""
|
source = dedent("""
|
||||||
x = ur''' '''
|
x = ur'''
|
||||||
|
|
||||||
def foo():
|
def foo():
|
||||||
pass
|
pass
|
||||||
x""")
|
""")
|
||||||
|
|
||||||
script = jedi.Script(dedent(source))
|
script = jedi.Script(dedent(source))
|
||||||
assert script.completions()
|
assert script.completions()
|
||||||
|
|||||||
Reference in New Issue
Block a user