Support restructured text in Pyright language server #6631
Replies: 5 comments 18 replies
-
The Microsoft Pylance team owns and maintains the docstring formatting functionality that is included in pyright. Could someone from the pylance team please transfer this issue to the pylance-release project? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Restructured text is only currently supported in Pylance (inside of VS code). Moving this to a discussion item for upvotes. |
Beta Was this translation helpful? Give feedback.
-
I see the same issue. In the original code documentation, the plain white spaces are converted to |
Beta Was this translation helpful? Give feedback.
-
i still feel that there should be some other option for formatting that includes some regular markdown view. |
Beta Was this translation helpful? Give feedback.
-
has there been any update for this topic? |
Beta Was this translation helpful? Give feedback.
-
Explanation and Screenshot
A clear and concise description of the behavior you are seeing and the expected behavior along with steps to reproduce it.
Pyright does not provide the correct formatting for docstrings of the numpy type format, see pic below.
The syntax has escapes for all the underscors, square brackets. Also there is an issue with the indentation in the hoverdocs where the indentation is correct in the docstring but it gets ignored past the first line for each parameter, kwarg etc.
This is with pyright installed in Neovim. using Mason to install and manage it. Using nvim-lspconfig to configure the language sever. The hover docs provider is the one provided by Nvim.
I have looked through the lsplogs and found that the text sent to the hover docs is exactly as written out here including the slashes infront of the underscores etc. The only thing that Nvim is doing is replacing the characters with whitespace untill visually selected. pic below shows the visual selection over that range showing the   chars.
Ideally the text sent to the hover docs would only have the whitespace chars instead of the , or at least it should maintain the use of the to continue the indentation inline with what is in the docstring. Also the misc slashes should be gone.
Please let me know if i should provide any more information to help solv but i believe this is a bug that should be fixed within pyright rather than a Nvim thing.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions