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

Go to definition always to module source insted of stub #326

Closed
luisiacc opened this issue Feb 18, 2021 · 7 comments
Closed

Go to definition always to module source insted of stub #326

luisiacc opened this issue Feb 18, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@luisiacc
Copy link

luisiacc commented Feb 18, 2021

I recommend to, whenever exists a module that have stubs (*.pyi), when triggering Go to Definition, don't ask me if I want to go to the stub file, just go straight to module source file. This feature was implemented in latest python extension of vscode, there, in order to go the the stub file you would have to trigger Go to Implementation, it's not a bad solution. Great extension btw! 👍

@fannheyward fannheyward added the enhancement New feature or request label Feb 18, 2021
@yaegassy
Copy link
Contributor

This behavior has been changed in pyright v1.1.110.

Behavior Change (from Pylance): Separated behavior of "go to definition" and "got to declaration". The former tries to take you to the source, whereas the latter takes you to the stub file.

I think that the expected behavior will be achieved by upgrading the version of pyright used in coc-pyright.

Related:

@luisiacc

This comment has been minimized.

@fannheyward
Copy link
Owner

You can :CocUninstall coc-pyright and :CocInstall coc-pyright to upgrade Pyright to latest release. I'll publish a new release of coc-pyright later, with some other fixes.

@AntoineD
Copy link

With last coc-pyright and pyright 1.1.115, the behavior has not changed for me and it still goes to the stub file instead of the source code.
Am I missing something to get it right?

@lainisourgod
Copy link

@fannheyward I'm not able to go to source files either.

For example, with pandas. When I don't use type stubs, and do GoToDefinition on DataFrame().sample(), I can go to source file.

However, when I use type stubs (from data-science-types) I can only go to type stubs definitions.
Annotation 2021-06-25 155043

@fannheyward
Copy link
Owner

@meandmymind what's your Pyright version? Checkout :CocCommand pyright.version

@lainisourgod
Copy link

@fannheyward coc-pyright 1.1.159 with Pyright 1.1.159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants