mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +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
|
||||
|
||||
for indent in indents[1:]:
|
||||
yield DEDENT, '', spos, ''
|
||||
yield ENDMARKER, '', spos, prefix
|
||||
yield DEDENT, '', (lnum, max), ''
|
||||
# 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)
|
||||
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