Show More
@@ -1375,18 +1375,18 b' class IPCompleter(Completer):' | |||
|
1375 | 1375 | try_jedi = True |
|
1376 | 1376 | |
|
1377 | 1377 | try: |
|
1378 | # should we check the type of the node is Error ? | |
|
1378 | # find the first token in the current tree -- if it is a ' or " then we are in a string | |
|
1379 | completing_string = False | |
|
1379 | 1380 | try: |
|
1380 | # jedi < 0.11 | |
|
1381 | from jedi.parser.tree import ErrorLeaf | |
|
1382 | except ImportError: | |
|
1383 | # jedi >= 0.11 | |
|
1384 | from parso.tree import ErrorLeaf | |
|
1381 | first_child = next(c for c in interpreter._get_module().tree_node.children if hasattr(c, 'value')) | |
|
1382 | except StopIteration: | |
|
1383 | pass | |
|
1384 | else: | |
|
1385 | # note the value may be ', ", or it may also be ''' or """, or | |
|
1386 | # in some cases, """what/you/typed..., but all of these are | |
|
1387 | # strings. | |
|
1388 | completing_string = len(first_child.value) > 0 and first_child.value[0] in {"'", '"'} | |
|
1385 | 1389 | |
|
1386 | next_to_last_tree = interpreter._get_module().tree_node.children[-2] | |
|
1387 | completing_string = False | |
|
1388 | if isinstance(next_to_last_tree, ErrorLeaf): | |
|
1389 | completing_string = next_to_last_tree.value.lstrip()[0] in {'"', "'"} | |
|
1390 | 1390 | # if we are in a string jedi is likely not the right candidate for |
|
1391 | 1391 | # now. Skip it. |
|
1392 | 1392 | try_jedi = not completing_string |
General Comments 0
You need to be logged in to leave comments.
Login now