##// END OF EJS Templates
Backport PR #11076: Disable Jedi completions by default
Thomas Kluyver -
Show More
@@ -576,9 +576,9 b' class Completer(Configurable):'
576 """
576 """
577 ).tag(config=True)
577 ).tag(config=True)
578
578
579 use_jedi = Bool(default_value=JEDI_INSTALLED,
579 use_jedi = Bool(default_value=False,
580 help="Experimental: Use Jedi to generate autocompletions. "
580 help="Experimental: Use Jedi to generate autocompletions. "
581 "Default to True if jedi is installed").tag(config=True)
581 "Off by default.").tag(config=True)
582
582
583 jedi_compute_type_timeout = Int(default_value=400,
583 jedi_compute_type_timeout = Int(default_value=400,
584 help="""Experimental: restrict time (in milliseconds) during which Jedi can compute types.
584 help="""Experimental: restrict time (in milliseconds) during which Jedi can compute types.
@@ -316,13 +316,17 b' def test_jedi():'
316 start = start if start is not None else l
316 start = start if start is not None else l
317 end = end if end is not None else l
317 end = end if end is not None else l
318 with provisionalcompleter():
318 with provisionalcompleter():
319 ip.Completer.use_jedi = True
319 completions = set(ip.Completer.completions(s, l))
320 completions = set(ip.Completer.completions(s, l))
321 ip.Completer.use_jedi = False
320 assert_in(Completion(start, end, comp), completions, reason)
322 assert_in(Completion(start, end, comp), completions, reason)
321
323
322 def _test_not_complete(reason, s, comp):
324 def _test_not_complete(reason, s, comp):
323 l = len(s)
325 l = len(s)
324 with provisionalcompleter():
326 with provisionalcompleter():
327 ip.Completer.use_jedi = True
325 completions = set(ip.Completer.completions(s, l))
328 completions = set(ip.Completer.completions(s, l))
329 ip.Completer.use_jedi = False
326 assert_not_in(Completion(l, l, comp), completions, reason)
330 assert_not_in(Completion(l, l, comp), completions, reason)
327
331
328 import jedi
332 import jedi
@@ -341,8 +345,10 b' def test_completion_have_signature():'
341 """
345 """
342 ip = get_ipython()
346 ip = get_ipython()
343 with provisionalcompleter():
347 with provisionalcompleter():
348 ip.Completer.use_jedi = True
344 completions = ip.Completer.completions('ope', 3)
349 completions = ip.Completer.completions('ope', 3)
345 c = next(completions) # should be `open`
350 c = next(completions) # should be `open`
351 ip.Completer.use_jedi = False
346 assert 'file' in c.signature, "Signature of function was not found by completer"
352 assert 'file' in c.signature, "Signature of function was not found by completer"
347 assert 'encoding' in c.signature, "Signature of function was not found by completer"
353 assert 'encoding' in c.signature, "Signature of function was not found by completer"
348
354
@@ -357,7 +363,9 b' def test_deduplicate_completions():'
357 zoo = 1
363 zoo = 1
358 '''))
364 '''))
359 with provisionalcompleter():
365 with provisionalcompleter():
366 ip.Completer.use_jedi = True
360 l = list(_deduplicate_completions('Z.z', ip.Completer.completions('Z.z', 3)))
367 l = list(_deduplicate_completions('Z.z', ip.Completer.completions('Z.z', 3)))
368 ip.Completer.use_jedi = False
361
369
362 assert len(l) == 1, 'Completions (Z.z<tab>) correctly deduplicate: %s ' % l
370 assert len(l) == 1, 'Completions (Z.z<tab>) correctly deduplicate: %s ' % l
363 assert l[0].text == 'zoo' # and not `it.accumulate`
371 assert l[0].text == 'zoo' # and not `it.accumulate`
@@ -3,6 +3,18 b''
3 ============
3 ============
4
4
5
5
6 .. _whatsnew631:
7
8 IPython 6.3.1
9 =============
10
11 This is a bugfix release to switch the default completions back to IPython's
12 own completion machinery. We discovered some problems with the completions
13 from Jedi, including completing column names on pandas data frames.
14
15 You can switch the completions source with the config option
16 :configtrait:`Completer.use_jedi`.
17
6 .. _whatsnew630:
18 .. _whatsnew630:
7
19
8 IPython 6.3
20 IPython 6.3
General Comments 0
You need to be logged in to leave comments. Login now