When coding, I face often a situation where I comment part of the code either temporarily or where some of the “language features” are actually used by coding something into the comments (e.g. Haskell doctests can be used to test and give working examples and there that tool find outs code from the comments).
It would be really cool to be able to highlight also those sections. Say, by using different tones of the comment color or something. The difficulty is of course to recognize what is normal comment text, and what is doctest part. This might be actually doable on haskell-mode as most of the time the doctests start with a special start string.
Anyhow, let’s not stop here. Often also, there are several languages involved. E.g. the comments may contain html-code while the actual code implements something that produces the html-code in the comments. It would be really cools if the html in the comments were highlighted, e.g. by using different tones of the comment color.
Doable at the moment? The html-snippets in the comments might also be recognizable so maybe.
Further, at least in haskell the comments can contain markdown-like-formatted text and that would be also nice to highlight.
Also, there are cases where I’d like to put code made in some other language into the comments. So maybe the question is that is there a tool that could be used to recognize, what language the particular lines in the comments is using? (A tool that should probably work probabilistically.) And then based on the information, feed the lines to highlighter. And in addition, this could be used to classify the text sections at the comments to natural language styled with markdown and to code made in various languages…