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

.pyi files inhibit docstrings from .py files from showing when hovering #2135

Closed
YodaEmbedding opened this issue Jul 31, 2021 · 1 comment
Closed
Labels
as designed Not a bug, working as intended

Comments

@YodaEmbedding
Copy link

YodaEmbedding commented Jul 31, 2021

Describe the bug
Docstrings from source (.py files) do not display when type stubs (.pyi files) exist.

To Reproduce
Install Python 3.9+.

import os
os.mkdir()

Attempt to obtain docstring of mkdir by hovering.

Expected behavior
Docstrings should appear when hovering.

VS Code extension or command-line
Neovim 0.5 built-in LSP.

Additional context
As more projects adopt .pyi files (e.g. Python standard library) which do not contain/mirror docstrings from source .py files, viewing documentation information about the code from within the editor becomes more and more difficult.

@erictraut
Copy link
Collaborator

Pylance, which is a language server built on top of the functionality in pyright, offers this feature. It merges doc strings from source files and associates it with type information from type stubs. We don't have any plans to port this functionality to pyright, which is primarily focused on type checking functionality. So if you want this functionality, you'll need to switch to pylance, which works only with VS Code.

@erictraut erictraut added the as designed Not a bug, working as intended label Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
as designed Not a bug, working as intended
Projects
None yet
Development

No branches or pull requests

2 participants