-
Notifications
You must be signed in to change notification settings - Fork 184
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
New whitespace / layout / styling PR #176
Conversation
About preserve_whitespace - is it not standard Markdown behaviour to ignore line breaks? |
@tomv564 I'm not sure. The |
So.. contents = contents.strip(' \t\r\n') I'm not sure what this accomplished. Trailing whitespace like this should be handled by the markdown conversion. contents.replace('\r\n', '\n') I'm not sure what the markdown engine expects or if it can be configured to deal with contents.replace('\t', '\u00A0' * 4)
contents.replace(' ', '\u00A0' * 2) These mirror what mdopups does to preserve whitespace in Concluding:
|
1
As As this replacement is now replaced by proper paragraph spacing it should be obsolete. 2Following @facelessuser's suggestion from the last PR the following snippet shows markdown to correctly convert paragraphs no matter which line ending was provided.
3 ConclusionSo I guess The only lines required to ensure correct indention of ascii docstrings are
|
Indeed, I can now remove most of the processing and it still looks good. 🤷♂️
(emphasis mine) I guess as the servers grow more mature they'll move away from ascii to markdown and eventually we will be able to remove all the processing? |
Not at the moment. pyls as an example forwards docstrings from jedi as is without any markdown conversion. Therefore removing whitespace replacement would break indention of all python docstrings. Don't see any sights for this behavior to change and I am even not sure whether it is always possible. We could file an issue at pyls to ask for changes, but ... ? |
Well that's always good I guess. For now just keep an eye on the thing and make sure no extra cruft is added? I updated to comments to be clearer about why it's needed. |
Tabs as used in python docstrings are not Markdown, work with python language server to improve hovers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the rebase and the explanation of preserve_whitespace!
What a step backwards in whitespace handling 👎 Is it hurting to keep fixed white spaces soo much? |
Replaces #168 after the codebase was split. Please refer to that PR for the epic ride towards the new good looking popups with code highlighting. It was pretty much impossible to rebase or merge this so I decided to re-implement.
Fixes #105 and fixes #82, pretty sure it also fixes #159
Please also note we should update our dependencies
Before:
After: