-
Notifications
You must be signed in to change notification settings - Fork 769
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
No docstrings in signature help when function is stubbed #784
Comments
@sebastianzolg, thanks for the questions. Responding to them:
Support for docstrings will improve as we support more formats and as type stubs get more docstrings. Hope you are enjoying Pylance and please let me know if there are any other questions I can answer |
Thank you very much, @judej, for your detailed answer. Very much appreciated! Why are the Jedi results in Jupyter Lab so much better than Pylance in VSCode? |
I believe that's the signature help tooltip; I think it "looks worse" because we aren't including the function docstring in that view. You'd see the same thing if you hit Ctrl+Shift+Space within the |
Thanks for your answer, @jakebailey ! Again, thank you very much for taking the time to explain this to me. |
"docstring" is just the text out of the python code triple quoted string; tooltip is the entire tooltip which can include information from the analysis as well as a docstring. If you hover over |
@jakebailey If I hover over |
@konstantin-schekotihin Just to confirm, is the above while in a juypter notebook, or in a regular file? |
@jakebailey In a Jupyter notebook. The mouse is over plt.figure() |
Your issue is likely microsoft/vscode-jupyter#4218, then, which will be fixed in their next release. |
Retitling this to match the original report, which was not having docstrings in the signature help. |
The issue here is that we haven't piped the source mapper through the signature help, which means we don't pull docstrings from real source if a stub is available. Hover and completion have done this, but signature help is missing it and is pulling info only from the immediately available AST nodes. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The original problem persists. There is still no docstring in the jupyter notebook for any functions, only the method header in the suggestions given from pylance. |
Please file a new issue with an example and screenshot of what you're describing. I'm not sure your issue is related to this one. |
That looks like the old Jupyter notebook UI, which I don't believe supports docstrings on signature help. |
is there a way to convert to the new UI in the non-insider edition of vs code. And why would the old UI be made the default for opening ipynb files if it isn't fully up to date? This was a new install of vs code that I tried it on. |
It's not the default because it's a work in progress. VS Code is still working on native notebook support; the old Jupyter UI was made from scratch. I think you can do:
Which will force you into the newer UI. |
I have the same issue nearly a year later. If I need to edit my .json settings, can you direct me to some basic instructions on how to do so? |
@deem-lab, this issue has been closed for the better part of a year. If you think that you are experiencing a bug with pylance, please open a new issue with details about what you're seeing. If you have questions about how to use pylance, feel free to post a question in the discussions tab. |
After switching over to Pylance (as suggested by the VS Code pop-up), I immediately discovered a big discrepancy between docstring support/formatting of Jedi and Pylance.
I've read several issues spread over various repos to find out the current state of docstring support. Honestly, I lost track.
Is it just me, or is this a little bit confusing?
From reading past issues, I came up with a few questions:
1) Why are there no additional docstrings for the most basic methods like
print()
2) What kind of formatting can I expect from docstrings displayed by Pylance?
I saw long and unreadable examples without any line break.
3) What is the discussion of "docstring only work for 3rd party libraries and not builtins" all about?
4) Why do we need stubs for libraries like Pandas to show docstrings?
I know that from reading other issues.
What can I expect from docstring support in the latest version?
My Setup:
OS: Windows 10
Python: 3.9.1
Python exts.: v2020.12.424452561
Pylance exts.: v2020.12.2
The text was updated successfully, but these errors were encountered: