Skip to content

Improve error message when Brittany is selected as a formatter and server is built without -fagpl #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
soywod opened this issue Aug 2, 2020 · 3 comments

Comments

@soywod
Copy link

soywod commented Aug 2, 2020

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.

@lukel97
Copy link
Collaborator

lukel97 commented Aug 2, 2020

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

@lukel97 lukel97 changed the title Formatter plugin: no formatter found for:[brittany] Improve error message when Brittany is selected as a formatter and server is built without -fagpl Aug 2, 2020
@soywod
Copy link
Author

soywod commented Aug 2, 2020

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!

@soywod soywod closed this as completed Aug 2, 2020
@soywod soywod reopened this Aug 2, 2020
jneira added a commit that referenced this issue Nov 14, 2020
Improve missing brittany format provider error message (#269)
@willbush
Copy link
Contributor

I think this issue can be closed now.

@fendor fendor closed this as completed Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants