Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow multiline strings to be rendered as comments #57
Conversation
Highlighting all multiline strings as comments seems really strange to me. Not sure about this, since it adds complexity and possibly making highlighting less performant. Also, there are a few string groups that haven't been split into multiline yet in this PR. |
And for me, not highlighting docstrings as comments looks weird in most colorschemes. I work a lot on data analysis code and docstrings spanning 50 lines are common. Hence a user configurable variable to turn it on/off depending on your preference. |
I understand the docstring usecase, but like I said highlighting all multiline strings as comments is weird and hacky. |
wmvanvliet commentedMar 8, 2019
•
edited
Picking this up from #45
So, docstrings are an important part of Python code and one may wish to render them as comments instead of normal strings. However, differentiating when a multiline string is being used as a docstring and when not, is tricky and probably slow.
In absence of a perfect solution, I propose the following. We split out multiline strings into their own class
pythonMultiString
. By default, it is linked toString
like we do with so many other string types:So, nothing changes out of the box.
However, if users want to assume all multiline strings are docstrings, they can add this to their configs:
and everyone can be happy.