haskell-vim icon indicating copy to clipboard operation
haskell-vim copied to clipboard

Add Haddock highlighting

Open johntyree opened this issue 10 years ago • 5 comments

I swiped some highlighting tricks from my old syntax/haskell.vim file. This particular group adds highlighting of Haddock docs as SpecialComments

johntyree avatar Sep 22 '15 05:09 johntyree

Stupid question. What benefits does this have? I thought SpecialComment was meant to be for things like pragmas? I'd personally prefer to have Pragmas stand out, once you have a lot of haddock in your code pragmas kind of fade to the background a little bit too much for my taste.

raichoo avatar Sep 22 '15 16:09 raichoo

There is a highlight group called "PreProc" that is used for C pragmas. I would think haddock is very the definition of a "special comment," as it is literally a comment with special meaning in some contexts.

If you have a lot of haddock and find it distracting, you might rather choose a less intense color, but personally I like it to stand out. If I find myself needing to refer to comments frequently to be able to understand and use my code, it is helpful to have a visual reminder that the doc-comments really should be exported.

It also helps identify places where I'm accidentally not writing haddock when I meant to, which is usually a silent error.

johntyree avatar Sep 23 '15 15:09 johntyree

I recall that I made the pragmas SpecialComment because ghc-mod is using this group to complete Language extensions and pragmas alike. Slipped my mind.

raichoo avatar Sep 25 '15 08:09 raichoo

Oh! Good to know...

Patching that is a much bigger pain...

johntyree avatar Sep 25 '15 13:09 johntyree

Is there any hope that this will be merged?

NickHu avatar Jul 26 '17 18:07 NickHu