Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outline GUI not working in __init__.py of a module #14871

Closed
8 tasks done
real-yfprojects opened this issue Mar 4, 2021 · 2 comments
Closed
8 tasks done

Outline GUI not working in __init__.py of a module #14871

real-yfprojects opened this issue Mar 4, 2021 · 2 comments

Comments

@real-yfprojects
Copy link
Contributor

real-yfprojects commented Mar 4, 2021

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with pip install -U spyder
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Retried in a new development environment
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

I am currently writing an python module in a spyder project. The __init__.py files classes aren't shown in the outline. I am not able to find any error message in the debug output.
If I rename the file to test.py, the outline immediately shows the classes as intended. After renaming the file back to __init__.py the outline doesn't show any classes again.
Outside a spyder project the outline works for the file. When I open the file in a different project it doesn't work.

After testing the things above I closed the project - and the outline didn't work, even after reopening the file.

I am therefore not able to postulate a rule when the problem occurs. It seems like it is more likely to occur within spyprojects.

Update 1

When looking at some code in the spyder repository I had this issue with other files as well. One didn't work even after renaming, the outline showed its loading animation. Another file worked after placing the cursor inside the linked line.

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

I see:

grafik

I expect something like that:

grafik

Versions

  • Spyder version: 4.2.3 [Spyder 5.0.0.dev0 (Commit: 670613c)]
  • Python version: 3.8.5 64-bit
  • Qt version: 5.12.10
  • PyQt version: PyQt5 5.12.3
  • Operating System name/version: Linux 5.4.0-66-generic
Dependencies

# Mandatory:
atomicwrites >=1.2.0            :  1.4.0 (OK)
chardet >=2.0.0                 :  4.0.0 (OK)
cloudpickle >=0.5.0             :  1.6.0 (OK)
diff_match_patch >=20181111     :  20200713 (OK)
intervaltree >=3.0.2            :  3.1.0 (OK)
IPython >=7.6.0                 :  7.19.0 (OK)
jedi =0.17.2                    :  0.17.2 (OK)
jsonschema >=3.2.0              :  3.2.0 (OK)
keyring >=17.0.0                :  21.7.0 (OK)
nbconvert >=4.0                 :  6.0.7 (OK)
numpydoc >=0.6.0                :  1.1.0 (OK)
parso =0.7.0                    :  0.7.0 (OK)
pexpect >=4.4.0                 :  4.8.0 (OK)
pickleshare >=0.4               :  0.7.5 (OK)
psutil >=5.3                    :  5.8.0 (OK)
pygments >=2.0                  :  2.7.3 (OK)
pylint >=1.0                    :  2.6.0 (OK)
pyls >=0.36.2;<1.0.0            :  0.36.2 (OK)
pyls_black >=0.4.6              :  0.4.6 (OK)
pyls_spyder >=0.3.2             :  0.3.2 (OK)
qdarkstyle >=2.8                :  2.8.1 (OK)
qtawesome >=0.5.7               :  1.0.2 (OK)
qtconsole >=5.0.1               :  5.0.1 (OK)
qtpy >=1.5.0                    :  1.9.0 (OK)
setuptools >=39.0.0             :  53.1.0 (OK)
sphinx >=0.6.6                  :  3.4.1 (OK)
spyder_kernels >=1.10.2;<1.11.0 :  1.10.2 (OK)
textdistance >=4.2.0            :  4.2.0 (OK)
three_merge >=0.1.1             :  0.1.1 (OK)
watchdog >=0.10.3;<2.0.0        :  1.0.2 (OK)
xdg >=0.26                      :  0.27 (OK)
zmq >=17                        :  20.0.0 (OK)

# Optional:
cython >=0.21                   :  None (NOK)
matplotlib >=2.0.0              :  3.3.3 (OK)
numpy >=1.7                     :  1.19.4 (OK)
pandas >=1.1.1                  :  None (NOK)
scipy >=0.17.0                  :  1.5.4 (OK)
sympy >=0.7.3                   :  1.7.1 (OK)

# Spyder plugins:
spyder_memory_profiler          :  0.2.1 (OK)
@real-yfprojects real-yfprojects changed the title Outline GUI not working in '__init__.py' of a module Outline GUI not working in __init__.py of a module Mar 4, 2021
@cdfredrick
Copy link

cdfredrick commented May 1, 2021

I have the same problem. When looking at an __init__.py file in the editor, the outline pane does not display any variables, functions, or classes. Special comments "# ----" and cells "# %%" do still appear in the outline, but cell hierarchy is flattened ("# %%%" does not appear nested beneath "# %%" in the outline). Using Spyder 5.0.1, Python 3.8.5 64-bit, Qt 5.9.7, PyQt5 5.9.2, Windows 10

@real-yfprojects
Copy link
Contributor Author

real-yfprojects commented May 13, 2021

I am able to reproduce the problem on the same machine but reliable even with the newest main version of Spyder (6.0.0.dev0 - Revision 474057d).

  1. I cloned this repository and switched to the develop branch.
  2. I created a new project from the existing repository directory.
  3. I opened this file called __init__.py.
The outline shows this.
  1. I closed the project in spyder.
  2. I opened the file again.
The outline now shows this.

If I knew how to talk to the pyls manually, I could inspect further which fault it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants