jyp / dante

389 stars 52 forks source link

`deferred-type-errors`, `typed-holes`, warnings are shown as errors #136

Closed DevJac closed 4 years ago

DevJac commented 4 years ago

https://github.com/jyp/dante/blob/38b589417294c7ea44bf65b73b8046d950f9531b/dante.el#L342 https://github.com/jyp/dante/blob/38b589417294c7ea44bf65b73b8046d950f9531b/dante.el#L907 These lines match a "warning: " message from GHC, and then create a flycheck error. Is this intended? I can make a PR to change this if desired.

I have changed this in my own dante install and everything seems to be working OK.

On closer inspection, simply deleting the two referenced lines would fix the issue I think? Because the lines following both of them are more general regexes that also match warnings.

jyp commented 4 years ago

This is done on purpose because typed-holes/type-errors, etc. are generally considered as errors rather than regular warnings. We normally allow them as warnings so that the file can be loaded in ghci and types can thus be queried. But conceptually they are errors.

DevJac commented 4 years ago

I can see where your coming from.

Personally, I just wanted dante to reflect the errors / warnings I would receive in my shell in the editor. With type holes, I receive warnings, and thus expected warnings in dante.

Is this something you'd be willing to make an option for? A variable dante users can customize to choose whether warnings show as warnings? Your call. I'd be willing to make a PR if you think it's OK.

jyp commented 4 years ago

You should be able to customize dante-flycheck-types to get what you want. Please let me know of any problem.