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
Hover: jsdoc portion should wrap to ~80-100 chars #69388
Comments
I do not think hover should do the wrapping and should show the hover as it is given by the extension. It is the responsibility of the extension to preserve the wrapping provided by the user while writing the doc. @mjbvz May I know if you are preserving the format of the js doc? |
JS/TS does not wrap text documentation text and also does not know the size of the hover Users can manually wrap jsdoc text if they wish (it is treated as markdown content so just end the line with a double space to hard wrap a line) |
I did not mean JS/TS server to wrap the text. I would expect they should preserve the format of the doc provided by the user. I checked that JS/TS is preserving the format but the markdown renderer is not showing the new lines. For eg JS/TS sends following markdown contents with new line characters at end of each line
But the markdown renderer is rendering it without respecting the new line characters. It was true even in stable that hover is not respecting the new line chars @jrieken Do you have any idea? |
About the wrapping? To my knowledge that's how markdown works. You need two line breaks to get a visible line break |
@mjbvz So new lines are missing when getting converted from a string to mark down. Can you please make sure new lines get preserved? |
@sandy081 This wrapping behavior is by design for markdown and I think it makes sense for documentation:
As @jrieken mentioned, you can add a hard wrap by ending a line with two spaces. |
@sandy081 markdown is working correctly imo, the wrapping has to be done by the hover as wrapping points are different depending on the font family, size, etc. The fix for this probably looks something like this: .hover .markdown {
max-width: Xpx
}
.hover .markdown .code {
/* break out of container in css or JS*/
} |
I see different tools take different approaches here. For eg., Sublime wraps as per how user wrapping. If the hover decides to wrap, then it should have same wrapping for all hovers. Otherwise the hovers look inconsistent. For eg., if we wrap TS/JS doc hovers at smaller width and leave others (like problems or hovers with code) with larger width it will look as below: @misolori FYI |
Fix is to have a smaller max width (500px) for hovers not containing code except for problem hovers. |
#69204
Version: 1.32.0-insider (user setup)
Commit: 393b48d
Date: 2019-02-25T01:34:48.785Z
Electron: 3.1.3
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.18841
It would be easier to read if wrapped somewhere around here (or a little more):
Maybe this should only apply the markdown sections that are not fenced code blocks.
The text was updated successfully, but these errors were encountered: