Highlight module and function docstrings as comments#17
Highlight module and function docstrings as comments#17robertoaloi merged 2 commits intoerlang-ls:mainfrom
Conversation
Highlight `io:fread` and `io:fwrite` control sequences in verbatim strings for convenience.
Set the syntax highlight to module and function documentation, more precisely to the docstring content of `-moduledoc` and `-doc` attributes to comment. This change distinguish documentation comments and source code, just as the old EDoc comments did, and as other languages do as well, for example Elixir.
13d5421 to
6115175
Compare
|
Thanks for this @KornelH , let me test this a bit and come back to you! |
|
Hi @KornelH, I finally got a chance to try this locally. First, let me say that the change is very welcome, since big docstrings can indeed be confusing. One thing I noticed is that the change is quite sensitive to formatting. For example, it doesn't work if there's a newline after a
Also, are there any plans about the
|
|
Hi @robertoaloi, I start with the second note, I didn't plan to do anything with Regarding the first note, I know about this issue but it is not related to the current or earlier docstring changes. It's an old standing problem in function expression syntax highlighting that is sensitive for formatting and breaks the following attributes. Before OTP 27 it was usually noticeable on |
Ah, fair enough. I didn't notice that before. Thanks for pointing that out, let's create an issue for that.
That's all right, we can tweak this as a follow-up. Just for reference, in ELP we are converting the old |
|
Thanks again for contributing this! 🎸 |
And there's already one: #1 |
|
Yesterday, I looked into what VSC thinks about tokens when the syntax highlight is broken and it is the implicit function expressions ( |







Set the syntax highlight to module and function documentation, more precisely to the docstring content of
-moduledocand-docattributes to comment.This change distinguish documentation comments and source code, just as the old EDoc comments did, and as other languages do as well, for example Elixir.
For more info, please check PR #9.
An additional change also included in the branch of this PR, highlight
io:freadandio:fwritecontrol sequences in verbatim strings for convenience.