mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-21 04:51:13 +08:00
The tokenize endmarker should really be the maximum position possible. Caused matplotlib to fail. Fixes davidhalter/jedi-vim#377.
This commit is contained in:
@@ -275,5 +275,6 @@ def generate_tokens(readline):
|
|||||||
yield OP, token, spos, prefix
|
yield OP, token, spos, prefix
|
||||||
|
|
||||||
for indent in indents[1:]:
|
for indent in indents[1:]:
|
||||||
yield DEDENT, '', spos, ''
|
yield DEDENT, '', (lnum, max), ''
|
||||||
yield ENDMARKER, '', spos, prefix
|
# As the last position we just take the max possible.
|
||||||
|
yield ENDMARKER, '', (lnum, max), prefix
|
||||||
|
|||||||
@@ -425,3 +425,16 @@ def test_incomplete_function():
|
|||||||
|
|
||||||
script = jedi.Script(dedent(source), 1, 3)
|
script = jedi.Script(dedent(source), 1, 3)
|
||||||
assert script.completions()
|
assert script.completions()
|
||||||
|
|
||||||
|
|
||||||
|
def test_string_literals():
|
||||||
|
"""Simplified case of jedi-vim#377."""
|
||||||
|
source = dedent("""
|
||||||
|
x = ur''' '''
|
||||||
|
|
||||||
|
def foo():
|
||||||
|
pass
|
||||||
|
x""")
|
||||||
|
|
||||||
|
script = jedi.Script(dedent(source))
|
||||||
|
assert script.completions()
|
||||||
|
|||||||
Reference in New Issue
Block a user