rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

Haddock coloration behaves strangely #464

Closed sir4ur0n closed 4 years ago

sir4ur0n commented 5 years ago

In my current application we are starting to use real Haddock documentation, and I noticed the plugin behaves weirdly sometimes.

Start by copy/pasting it:

-- |foo
foo :: Bool
foo = True

-- |foo should be correctly displayed in green.

Now put your cursor at the end of this doc line and type enter. I think it would be a great improvement that it automatically adds -- to the beginning of the line because we are continuing the documentation.

Nevertheless, type -- bar. This is displayed in grey (regular comment) instead of green (Haddock) 😢

Now remove the last character. The grey block of documentation turns green! It also becomes green if you go to a green line and modify it (e.g. press space).

I don't know what this is about, but it would be great if at least the 2 display bugs could be fixed. It would be even better if hitting enter at the end of a Haddock line automatically added -- to the next line.

And it would be 100% perfect if refreshing the Haddock display in Intellij (at least for our own code) didn't require to use (Re)Build Hoogle database, but I guess this is too much asking ^^

By any chance, is this something easily fixable? If yes, I may try to take a look :x

Cheers!

rikvdkleij commented 5 years ago

Thanks for reporting!

I will let you know but will be next week.

rikvdkleij commented 5 years ago

The issues, except for refreshing the Haddock display, are fixable but not easy because it expects knowledge of the parser.

The Haddock display issue can only be fixed by parsing the Haddock comments by the plugin itself...

rikvdkleij commented 4 years ago

@Sir4ur0n Took some time but is fixed in next release except for refreshing Haddock display in project code.

sir4ur0n commented 4 years ago

Did you mean release 63 (already released) or release 64 (not yet released)? I just tried with 63 and it behaves the same

rikvdkleij commented 4 years ago

I mean release 64.

rikvdkleij commented 4 years ago

@Sir4ur0n Beta64 is released.

sir4ur0n commented 4 years ago

I confirm this works, this is an excellent improvement :heart:

Thank you again :pray: