-
Notifications
You must be signed in to change notification settings - Fork 771
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
Support Markdown Docstrings #41
Comments
If markdown is supported then please don't assume everything is markdown, in that case it's better to have no formatting at all, there are many docstrings that contain google/numpy/sphinx-style formatting and many docstrings that don't use any format at all. The situation is already bad with both Jedi and MLS backends. |
The best I could personally come up with is pretty custom but it is actually pretty practical.
Coming from TypeScript the docs being basically impossible to read in the normally used google format was painful. In addition, it automatically escapes
|
Would be nice to be able to set the docstring format on a per package basis. Docstrings for your package may be in Markdown, so in your workspace settings.json, you could set the setting there to parse docstrings as markdown for your specific package, while other packages maybe in Google or reST syntax. |
I believe that the original issue here was mainly about the docstrings with indention being poorly formatted; they are markdown, but we have to do some conversion of other formats (such as those in the original report). Here are some of the snippets from @bradennapier with the next version: Some of the other escapes are going to be fixed as well, though the |
This issue has been fixed in version 2021.2.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202120-3-february-2021 |
Since VS Code can display Markdown in the autocompletion dropdown and help boxes, it would be helpful to have this be extended to docstrings. Currently, docstrings only display as raw text with the occasional syntax highlight, as seen below:
However, it is clear that VS Code supports Markdown in these boxes (i.e. for module descriptions, below)

So, I believe that a good Pylance enhancement would be to support Markdown in the docstrings as well. What I'm imagining would be useful would be have something show up similar to the modules with italicized and bolt text, lists, etc.; so as an example the original docstring would look how it looks below.
Access top x extensions from current platform
Args:
The text was updated successfully, but these errors were encountered: