spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.33k stars 1.61k forks source link

Code analysis jump to line does not work for some files #9647

Open oscargus opened 5 years ago

oscargus commented 5 years ago

Issue Report Checklist

Problem Description

In some files, it seems like the jump to line feature does not work. See animation, where for the file plugin.py it does not work, while for the api.py (and all other open files) it does work.

codeanalysisissue

I came across this while working on #9646 and thought it was caused by my changes, but the clip is for the current master. Anyway, it means that I made some tests to look into it and I can at least say that this code https://github.com/spyder-ide/spyder/blob/be4666163a4a8b088f91bb41fc704a7a81fbf735/spyder/plugins/pylint/widgets/pylintgui.py#L72 executes with the correct fname and lineno.

I have, before recording the behaviour (and a few times before that), regenerated the pylint output. It has happened on another file as well, but I do not remember which one. Right now, spyder\plugins\history\plugin.py seems to be the file that doesn't work. It does not matter if I have any other files open or not. I have also removed the pylintresults file (not that it should matter since the emit call seems correct) but still the same result.

What steps reproduce the problem?

  1. Open spyder\plugins\history\plugin.py
  2. Enable "Code analysis" pane
  3. Start code analysis for file
  4. Try to jump to a line by clicking on one of the issues

What is the expected output? What do you see instead?

The requested line should be jumped to.

Versions

Dependencies

pygments >=2.0     :  2.4.2 (OK)
qdarkstyle >=2.6.4 :  2.7 (OK)
sphinx >=0.6.6     :  2.1.0 (OK)
pyls >=0.19.0;<0.25:  0.24.0 (OK)
nbconvert >=4.0    :  5.5.0 (OK)
pandas >=0.13.1    :  None (NOK)
numpy >=1.7        :  None (NOK)
sympy >=0.7.3      :  None (NOK)
cython >=0.21      :  None (NOK)
qtconsole >=4.5.0  :  4.5.1 (OK)
IPython >=4.0      :  7.5.0 (OK)
matplotlib >=2.0.0 :  None (NOK)
pylint >=0.25      :  2.3.1 (OK)
ccordoba12 commented 5 years ago

@steff456, please take a look at this one.