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

Show Type Hierarchy in notebook fails to find subtypes of type imported from .py file #5858

Open
debonte opened this issue May 8, 2024 · 0 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@debonte
Copy link
Contributor

debonte commented May 8, 2024

Environment data

  • Language Server version: 2024.5.1
  • OS and version: Windows 11
  • Python version: 3.12.1

Code Snippet

# test2.py

class ExternalBase:
    def method(self):
        pass

class ExternalDerived(ExternalBase):
    def method(self):
        pass
# Cell in notebook.ipynb

from test2 import ExternalDerived

class Base(ExternalDerived):
    def method(self):
        pass

class Derived(Base):
    def method(self):
        super().method()

class MoreDerived(Derived):
    def method(self):
        pass

Repro Steps

  1. Open a folder.
  2. Create notebook and Python file as shown above.
  3. In the notebook, initiate Show Type Hierarchy on Base. Note that it can show the subtypes (defined in the notebook) and the supertypes (defined in test2.py).
  4. In the notebook, initiate Show Type Hierarchy on ExternalDerived.

Expected behavior

Type hierarchy includes both the supertype (ExternalBase from test.py) and the subtypes (defined in the notebook).

Actual behavior

Type hierarchy only shows the supertype.

It looks like this is a workspace issue. The workspace that is chosen in the Base scenario includes both the notebook cells and test2.py. The workspace that is chosen in the ExternalDerived scenario does not include the notebook cells.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants