From b361305a4e9bb919e63c5214539b61d4a5a616c9 2018-04-06 08:49:11 From: Thomas Kluyver Date: 2018-04-06 08:49:11 Subject: [PATCH] Backport PR #11076: Disable Jedi completions by default --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index cee7833..fbc2535 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -576,9 +576,9 @@ class Completer(Configurable): """ ).tag(config=True) - use_jedi = Bool(default_value=JEDI_INSTALLED, + use_jedi = Bool(default_value=False, help="Experimental: Use Jedi to generate autocompletions. " - "Default to True if jedi is installed").tag(config=True) + "Off by default.").tag(config=True) jedi_compute_type_timeout = Int(default_value=400, help="""Experimental: restrict time (in milliseconds) during which Jedi can compute types. diff --git a/IPython/core/tests/test_completer.py b/IPython/core/tests/test_completer.py index b7012ce..5a60e58 100644 --- a/IPython/core/tests/test_completer.py +++ b/IPython/core/tests/test_completer.py @@ -316,13 +316,17 @@ def test_jedi(): start = start if start is not None else l end = end if end is not None else l with provisionalcompleter(): + ip.Completer.use_jedi = True completions = set(ip.Completer.completions(s, l)) + ip.Completer.use_jedi = False assert_in(Completion(start, end, comp), completions, reason) def _test_not_complete(reason, s, comp): l = len(s) with provisionalcompleter(): + ip.Completer.use_jedi = True completions = set(ip.Completer.completions(s, l)) + ip.Completer.use_jedi = False assert_not_in(Completion(l, l, comp), completions, reason) import jedi @@ -341,8 +345,10 @@ def test_completion_have_signature(): """ ip = get_ipython() with provisionalcompleter(): + ip.Completer.use_jedi = True completions = ip.Completer.completions('ope', 3) c = next(completions) # should be `open` + ip.Completer.use_jedi = False assert 'file' in c.signature, "Signature of function was not found by completer" assert 'encoding' in c.signature, "Signature of function was not found by completer" @@ -357,7 +363,9 @@ def test_deduplicate_completions(): zoo = 1 ''')) with provisionalcompleter(): + ip.Completer.use_jedi = True l = list(_deduplicate_completions('Z.z', ip.Completer.completions('Z.z', 3))) + ip.Completer.use_jedi = False assert len(l) == 1, 'Completions (Z.z) correctly deduplicate: %s ' % l assert l[0].text == 'zoo' # and not `it.accumulate` diff --git a/docs/source/whatsnew/version6.rst b/docs/source/whatsnew/version6.rst index 383cfe9..9fc6fa4 100644 --- a/docs/source/whatsnew/version6.rst +++ b/docs/source/whatsnew/version6.rst @@ -3,6 +3,18 @@ ============ +.. _whatsnew631: + +IPython 6.3.1 +============= + +This is a bugfix release to switch the default completions back to IPython's +own completion machinery. We discovered some problems with the completions +from Jedi, including completing column names on pandas data frames. + +You can switch the completions source with the config option +:configtrait:`Completer.use_jedi`. + .. _whatsnew630: IPython 6.3