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

goto definition actually open pyi file instead of the actual py file #2304

Closed
braindevices opened this issue Jan 28, 2022 · 2 comments
Closed
Labels
P2 waiting for upstream Waiting for upstream to release a fix

Comments

@braindevices
Copy link

this is probably regression of #65

Environment data

  • Language Server version: 2022.1.5
  • OS and version: linux x64
  • Python version (and distribution if applicable, e.g. Anaconda):
  • python.analysis.indexing: null
  • python.analysis.typeCheckingMode: strict

Behaviour

when the package contain stub files (*.pyi), the goto definition open the pyi file instead of the actual py file.

Expected vs. Actual Behaviour

it should open the py file where the member is actually defined, when use goto definition. Only open pyi file when use goto declaration

Steps to reproduce:

in a py script contains following code:

import numpy
print(numpy.dtype)

right click on dtype and try any of the goto command, we will see it opens __init__.pyi instead of _multiarray_umath.py

@judej judej added the needs investigation Could be an issue - needs investigation label Jan 31, 2022
@github-actions github-actions bot removed the triage label Jan 31, 2022
@luabud luabud added the P2 label Mar 1, 2022
@judej
Copy link
Contributor

judej commented Mar 8, 2022

Thanks for the report. Will investigate this.

@bschnurr
Copy link
Member

I'd log an issue with numpy.

looks like its due to numpy defining dtype in __init__.pyi instead of importing it from numpy.core.multiarray like this

image

assuming they also move their dytpe stub definition from numpy/__init__.pyi to numpy/core/multiarrar.pyi as well.

@bschnurr bschnurr added waiting for upstream Waiting for upstream to release a fix needs stub and removed needs investigation Could be an issue - needs investigation needs stub labels Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 waiting for upstream Waiting for upstream to release a fix
Projects
None yet
Development

No branches or pull requests

4 participants