##// END OF EJS Templates
Merge pull request #12157 from meeseeksmachine/auto-backport-of-pr-12128-on-7.x...
Matthias Bussonnier -
r25554:35eae74e merge
parent child Browse files
Show More
@@ -1375,18 +1375,18 b' class IPCompleter(Completer):'
1375 try_jedi = True
1375 try_jedi = True
1376
1376
1377 try:
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 try:
1380 try:
1380 # jedi < 0.11
1381 first_child = next(c for c in interpreter._get_module().tree_node.children if hasattr(c, 'value'))
1381 from jedi.parser.tree import ErrorLeaf
1382 except StopIteration:
1382 except ImportError:
1383 pass
1383 # jedi >= 0.11
1384 else:
1384 from parso.tree import ErrorLeaf
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 # if we are in a string jedi is likely not the right candidate for
1390 # if we are in a string jedi is likely not the right candidate for
1391 # now. Skip it.
1391 # now. Skip it.
1392 try_jedi = not completing_string
1392 try_jedi = not completing_string
General Comments 0
You need to be logged in to leave comments. Login now