Spyder: Calltips not showing in editor for some functions with Jedi 0.15

Created on 23 Mar 2020  路  9Comments  路  Source: spyder-ide/spyder

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [x] Could not reproduce inside jupyter qtconsole (if console-related)
  • [x] Tried basic troubleshooting (if a bug/error)

    • [x] Restarted Spyder

    • [x] Reset preferences with spyder --reset

    • [x] Reinstalled the latest version of Anaconda

    • [x] Tried the other applicable steps from the Troubleshooting Guide

  • [x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

For some functions the calltip does not show up in the editor (but does in the console)

What steps reproduce the problem?

  1. import numpy as np
  2. Typing x = np.linspace( in
  3. the console: shows the calltip
  4. the editor: does not show the calltip

With other functions like np.arange the calltip shows up in both the editor and the console.

Versions

  • Spyder version: 4.1.1
  • Python version: 3.7.6
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Linux 5.5.10

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.3.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.3.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.13.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
keyring                        :  None (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.9 (OK)
qdarkstyle >=2.8               :  2.8 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.1 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.3 (OK)
sphinx >=0.6.6                 :  2.4.0 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
xdg >=0.26                     :  0.26 (OK)
zmq >=17                       :  18.1.1 (OK)

# Optional:
cython >=0.21                  :  None (OK)
matplotlib >=2.0.0             :  3.1.3 (OK)
numpy >=1.7                    :  1.18.1 (OK)
pandas >=0.13.1                :  None (OK)
scipy >=0.17.0                 :  1.4.1 (OK)
sympy >=0.7.3                  :  None (OK)
Editor Bug

All 9 comments

You're right and thanks for reporting. We'll take a look at this in the coming weeks.

@ccordoba12 @remisalmon after some testing seems like the issue is in Jedi.

Testing with Jedi 0.15.2 an empty list is retrieved by call_signatures:

from jedi import Script
txt = """import numpy as np
np.linspace(
"""
script = Script(txt, 2, 12)
call_signature = script.call_signatures()

call_signature -> []

While with Jedi 0.14.1, a signature is retrieved:

from jedi import Script
txt = """import numpy as np
np.linspace(
"""
script = Script(txt, 2, 12)
call_signature = script.call_signatures()

call_signature -> [<CallSignature: linspace index=0 params=[start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0]>]

@dalthviz, what happens with Jedi 0.16?

Will check :+1:

I can reproduce @dalthviz's tests: call_signatures on np.linspace does not work with jedi==0.15.2 but does with 0.16.0 (and 0.15.1 too...)

@ccordoba12 with jedi 0.16 a Signature is retrieved ([<Signature: index=0 linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0)>]).

Updating the pyls requirement to allow jedi<=0.16 works for me:

pyls

Also, thank you @remisalmon for checking the other Jedi versions :+1:

Ok, thanks @dalthviz!

@andfoy, this should be fixed once we update to Jedi 0.17 in the PyLS and here. However, to test that it doesn't break in future Jedi versions, please add a test for it in the PyLS repo.

I can confirm this was fixed by updating to Jedi 0.17.

Was this page helpful?
0 / 5 - 0 ratings