mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-26 15:23:17 +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:
1 parent
47d468a9bc
commit
902482568e
2 files changed
+16
-2
No files matched your search
@@ -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