1
0
forked from VimPlug/jedi

Break Interpreter completion even more in favor of a better solution in the future.

This commit is contained in:
Dave Halter
2016-06-03 19:31:42 +02:00
parent 0c7894b3e6
commit 5edcf47512
9 changed files with 73 additions and 30 deletions

View File

@@ -139,9 +139,15 @@ def get_stack_at_position(grammar, source, module, pos):
pass
def tokenize_without_endmarker(code):
for token_ in tokenize.source_tokens(code, use_exact_op_types=True):
tokens = tokenize.source_tokens(code, use_exact_op_types=True)
for token_ in tokens:
if token_[0] == token.ENDMARKER:
raise EndMarkerReached()
elif token_[0] == token.DEDENT:
# Ignore those. Error statements should not contain them, if
# they do it's for cases where an indentation happens and
# before the endmarker we still see them.
pass
else:
yield token_