diff --git a/jedi/api/helpers.py b/jedi/api/helpers.py index 231185f1..5ed694f8 100644 --- a/jedi/api/helpers.py +++ b/jedi/api/helpers.py @@ -95,7 +95,6 @@ def get_stack_at_position(grammar, source, module, pos): else: if user_stmt is None: user_stmt = module.get_leaf_for_position(pos, include_prefixes=True) - print(user_stmt) if pos <= user_stmt.start_pos: try: leaf = user_stmt.get_previous_leaf() @@ -103,6 +102,7 @@ def get_stack_at_position(grammar, source, module, pos): pass else: user_stmt = get_user_or_error_stmt(module, leaf.start_pos) + print(user_stmt, leaf.start_pos) # Only if were in front of the leaf we want to get the stack, # because after there's probably a newline or whatever that would # be actually tokenized and is not just prefix. @@ -128,7 +128,6 @@ def get_stack_at_position(grammar, source, module, pos): # Error leafs cannot be parsed. raise OnErrorLeaf(user_stmt) - print(user_stmt.start_pos, pos) code = _get_code(source, user_stmt.start_pos, pos) # Remove whitespace at the end. Necessary, because the tokenizer will parse # an error token (there's no new line at the end in our case). This doesn't diff --git a/test/completion/decorators.py b/test/completion/decorators.py index 05ba5775..7c4da05f 100644 --- a/test/completion/decorators.py +++ b/test/completion/decorators.py @@ -38,7 +38,7 @@ exe[1] #? set exe[2] #? [] -exe[3][0] +exe[3][0]. #? str() exe[4]['d'] @@ -70,7 +70,7 @@ exe[1] #? set exe[2] #? [] -exe[3][0] +exe[3][0]. #? str() exe[4]['d'] diff --git a/test/completion/descriptors.py b/test/completion/descriptors.py index 86e3a3d0..4741778b 100644 --- a/test/completion/descriptors.py +++ b/test/completion/descriptors.py @@ -62,14 +62,14 @@ class B(): p = property(t) #? [] -B().r() +B().r(). #? int() B().r #? str() B().p #? [] -B().p() +B().p(). class PropClass(): def __init__(self, a): diff --git a/test/completion/functions.py b/test/completion/functions.py index d444ff97..f56010bf 100644 --- a/test/completion/functions.py +++ b/test/completion/functions.py @@ -368,12 +368,12 @@ def nested_args2(*args, **kwargs): #? int() nested_args('', 1, 1.0, list) #? [] -nested_args('') +nested_args(''). #? int() nested_args2('', 1, 1.0) #? [] -nested_args2('') +nested_args2(''). # ----------------- # nested **kwargs @@ -397,9 +397,9 @@ nested_kw(a=3.0, b=1) #? int() nested_kw(b=1, a=r"") #? [] -nested_kw(1, '') +nested_kw(1, ''). #? [] -nested_kw(a='') +nested_kw(a=''). #? int() nested_kw2(b=1) @@ -408,9 +408,9 @@ nested_kw2(b=1, c=1.0) #? int() nested_kw2(c=1.0, b=1) #? [] -nested_kw2('') +nested_kw2(''). #? [] -nested_kw2(a='') +nested_kw2(a=''). #? [] nested_kw2('', b=1). @@ -430,14 +430,14 @@ nested_both('', b=1, c=1.0, list) nested_both('', c=1.0, b=1, list) #? [] -nested_both('') +nested_both(''). #? int() nested_both2('', b=1, c=1.0) #? int() nested_both2('', c=1.0, b=1) #? [] -nested_both2('') +nested_both2(''). # ----------------- # nested *args/**kwargs with a default arg @@ -464,7 +464,7 @@ nested_def2('', b=1, c=1.0)[1] #? int() nested_def2('', c=1.0, b=1)[1] #? [] -nested_def2('')[1] +nested_def2('')[1]. # ----------------- # magic methods diff --git a/test/completion/generators.py b/test/completion/generators.py index 07c4b72f..faf65bf7 100644 --- a/test/completion/generators.py +++ b/test/completion/generators.py @@ -22,7 +22,7 @@ def gen_ret(value): next(gen_ret(1)) #? [] -next(gen_ret()) +next(gen_ret()). # generators evaluate to true if cast by bool. a = '' @@ -42,7 +42,7 @@ def get(param): yield "" #? [] -get()[0] +get()[0]. # ----------------- # __iter__ diff --git a/test/completion/ordering.py b/test/completion/ordering.py index bd7e48b3..61eb1928 100644 --- a/test/completion/ordering.py +++ b/test/completion/ordering.py @@ -86,8 +86,8 @@ from os import path # should not return a function, because `a` is a function above def f(b, a): return a -#? ['in', 'is', 'and', 'if', 'or', 'not'] -f(b=3) +#? [] +f(b=3). # ----------------- # closure