I try to replace Ormolu by Brittany, but I get this message: Formatter plugin: no formatter found for:[brittany]. I'm using Neovim + Coc, here my config:
"languageserver": {
"haskell": {
"command": "haskell-language-server-wrapper",
"args": ["--lsp"],
"filetypes": [
"hs",
"lhs",
"haskell"
],
"rootPatterns": [
"*.cabal",
"stack.yaml",
"cabal.project",
"package.yaml"
],
"initializationOptions": {
"haskell": {
"formattingProvider": "brittany"
}
}
},
I tried to installed brittany globally and locally (inside my project), but I still get the same error. I'm using ghc v8.8.4 with stack v2.3.1.
It could be interesting to add a tiny section about how to use a different formatting provider.
Ah, for the Brittany formatter you need to build Haskell-language-server from source with the -fagpl cabal flag. You shouldn't need to add Brittany as a dependency to your project! The binaries are built without this for licensing reasons, but indeed the error message should be better about this. I'll convert this into a todo
Indeed, works like a charm after adding agpl: true in the flags section of the stack.yaml and compiling with stack ./install.hs hls-8.8.4. Thank you!
I think this issue can be closed now.
Most helpful comment
Ah, for the Brittany formatter you need to build Haskell-language-server from source with the -fagpl cabal flag. You shouldn't need to add Brittany as a dependency to your project! The binaries are built without this for licensing reasons, but indeed the error message should be better about this. I'll convert this into a todo