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 goes to stub files instead of actual definitions #1808

Closed
kylebebak opened this issue Oct 19, 2021 · 1 comment
Closed

Goto definition goes to stub files instead of actual definitions #1808

kylebebak opened this issue Oct 19, 2021 · 1 comment

Comments

@kylebebak
Copy link

This makes code navigation in the standard library a lot less useful. In the standard library there are no inlined type annotations; there are type stubs for almost everything.

This means Jedi won't show you doc strings for most things in the standard library. It also makes code navigation in 3rd party libraries that use type stubs instead of inlined type annotations a lot less useful, for the same reason.

This is basically a duplicate of these pylance issues:

Would there be a way to have goto definition go to source code rather than type stubs, even if type stubs exist?

@davidhalter
Copy link
Owner

Which language server are you using?

The thing is: Jedi is flexible, have a look:

def goto(self, line=None, column=None, *, follow_imports=False, follow_builtin_imports=False,
         only_stubs=False, prefer_stubs=False):                             

Someone probably used prefer_stubs=True. This is probably an oversight on their end OR (more likely) you are are using the wrong LSP commands :) There's goto "definition" and goto "implementation", whereas the later should land in the standard library. BTW: There's also goto "typeDefinition", which is something else again.

This is basically a duplicate of these pylance issues:

No, those issues actually say the exact opposite thing.

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

No branches or pull requests

2 participants