Closed memeplex closed 3 years ago
I don't see a "hardbreaks" issue with argparse.ArgumentParser
. That is separate issue taken care in microsoft/vscode-python#5577
The "hardbreaks" issue occurs with torch
.
I have edited the issue accordingly.
This is interesting, notice how well the documentation for os
is formatted here:
There original has hard breaks like this:
Programs that import and use 'os' stand a better chance of being
portable between different platforms. Of course, they must then
only use functions that are defined by all platforms (e.g., unlink
and opendir), and leave all pathname manipulation to os.path
(e.g., split and join).
Some kind of processing is happening there, don't you think?
Agree, can you please comment these queries on the upstream jedi issue. The maintainers of jedi would know more about it.
Do these better formatted queries also come already formatted from jedi?
We do post-processing of this
productivity with parameter hint in vscode could have monospace font and rendered in pre tag by default;
how to write in free typing, consistent documentation in vscode [?] since vscode is built in css and html, you developers could just add a pre tag with monospace font where parameter hint custom content are rendered;
As with #1848, I believe this is fine in Pylance.
Environment data
Expected behaviour
Tooltip text flows naturally disregarding hard breaks in the original docstring.
Actual behaviour
Natural text flow is interrupted because of the interaction between the width of the tooltip popup and the location of hard breaks in the docstring (which assume a larger viewport).
ISSUE HERE
Hardbreak after "input" interrupt the natural flow.
Steps to reproduce:
JEDI AS INTELLISENSE IS SELECTED
import torch
torch.nn.Conv2d(
Some suggestions
Many editors (vscode included) provide heuristic text formatters as builtins or as extensions.
Alt-q
(fill-paragraph) https://www.gnu.org/software/emacs/manual/html_node/emacs/Fill-Commands.htmlMoreover, font size could be reduced (indeed, for a tooltip, current size looks too big). Atom does this and the popups are really not much larger than vscode ones, but the layout of the text is superior.
Related issues
https://github.com/microsoft/vscode-python/issues/5577, https://github.com/microsoft/vscode-python/issues/5610, https://github.com/microsoft/vscode/issues/14165, https://github.com/microsoft/vscode/issues/38663
Some of the referenced issues suggest that changes upstream could improve the situation for vscode-python, but anyway I believe there still is room for improvement and no popup width short of 80 characters will ever be right, anyway.