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

Add new plugins

Open begriffs opened this issue 8 years ago • 5 comments

begriffs avatar Apr 24 '17 03:04 begriffs

hindent can sort imports and v5.2.3 can sort explicit import lists.

jship avatar May 18 '17 03:05 jship

What's your opinion of https://github.com/lspitzner/brittany as a replacement for hindent?

begriffs avatar May 20 '17 17:05 begriffs

brittany is nice but it's novelty shows from some local testing. It choked on some Template Haskell and some tuple sections, even with the relevant ghc options passed in via config.yaml. It also doesn't deal with "data-decls, classes, instances, imports/exports", so hindent is a more batteries-included package right now.

Does seem to have smarter newline wrapping though:

From Hindent:

userResetRequest :: Request
userResetRequest =
  baseRequest & setRequestPath "/ToolNavigation.asp" &
  setRequestBodyURLEncoded
    [ ("FactoryDefaultConfirm", "0")
    , ("RestoreDefaultsNo", "0x00")
    , ("UserResetYes", "0x01")
    ]

From brittany:

userResetRequest :: Request
userResetRequest =
  baseRequest & setRequestPath "/ToolNavigation.asp" & setRequestBodyURLEncoded
    [ ("FactoryDefaultConfirm", "0")
    , ("RestoreDefaultsNo"    , "0x00")
    , ("UserResetYes"         , "0x01")
    ]

The showcase output compared to hindent is more pleasing to me too: https://github.com/lspitzner/brittany/blob/71d7abc00793681fba056040fd38c65c6abb8b94/Showcase.md

brittany uses ghc-exactPrint while hindent uses haskell-src-exts, which in the long run will likely give brittany the upper hand. I don't feel it's ready for prime time yet though.

jship avatar May 20 '17 18:05 jship

Brittany is now on Stackage. So if/when we want to switch to it, should be easy to do.

begriffs avatar Nov 08 '17 16:11 begriffs

Nice! :tada: Would be good to test out brittany again.

jship avatar Nov 09 '17 02:11 jship