MaxGabriel / brittany-vscode-extension

VSCode formatting extension for the brittany Haskell code formatter
MIT License
9 stars 1 forks source link

Format on Save stopped working on latest NixOS (24.05)? #31

Closed TheOddler closed 4 months ago

TheOddler commented 4 months ago

I'm on NixOS and just updated to 24.05 and this seems to have stopped working. Well, I can still do the command Format Document With... and select Brittany, but Format on Save does not work any more.

In the output console I get this error:

2024-06-06T08:47:35.691726Z | Warning | No plugin enabled for STextDocumentFormatting
[Warn  - 9:47:35 AM] No plugin enabled for STextDocumentFormatting
[Error - 9:47:35 AM] Request textDocument/formatting failed.
  Message: No plugin enabled for STextDocumentFormatting, available: ormolu, stylish-haskell, cabalfmt, floskell, fourmolu
  Code: -32600 

I'm not sure if this is a problem with this plugin, it seems it doesn't register Bittany correctly any more? Or maybe it's because of a change in the Haskell plugin. Not sure.

TheOddler commented 4 months ago

Ok I fixed it, I needed to set

  "[haskell]": {
    "editor.defaultFormatter": "MaxGabriel.brittany"
  }

in my vscode settings and then it works again. Selecting brittany as the formatter in the Haskell settings in vs code (which sets "haskell.formattingProvider": "brittany" in the settings file) does not work.