haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.71k stars 368 forks source link

cannot format document in vscode #3609

Closed scarf005 closed 1 year ago

scarf005 commented 1 year ago

Your environment

Which OS do you use? Ubuntu 23.04 Which version of GHC do you use and how did you install it? 9.6.1, via ghcup tui

How is your project built (alternative: link to the project)? a plain directory with a single haskell file.

.
├── Century.hs
├── Grow.hs
└── Pillars.hs

1 directory, 3 files

Which LSP client (editor/plugin) do you use? VsCode + Haskell extension

Which version of HLS do you use and how did you install it? 1.10.0.0 via ghcup tui

Have you configured HLS in any way (especially: a hie.yaml file)? No.

Formatting settings image ormolu

Steps to reproduce

  1. ctrl+shift+p to open a command palette. run format document.
  2. it does not work.

image

  1. ctrl+shift+p to open a command palette. run format document with. select Haskell.

Expected behaviour

the document is formatted.

Actual behaviour

image

no plugin enabled for STextDocumentFormatting, enabled: cabalfmt

Debug information

2023-05-27T23:39:53.105570Z | Warning | No plugin enabled for STextDocumentFormatting
[Warn  - 오전 8:39:53] No plugin enabled for STextDocumentFormatting
[Error - 오전 8:39:53] Request textDocument/formatting failed.
  Message: No plugin enabled for STextDocumentFormatting, available: cabalfmt
  Code: -32600 
2023-05-27T23:39:53.121665Z | Info | Typechecking reverse dependencies for NormalizedFilePath "/home/scarf/repo/etc/haskell/codewars/Century.hs": [  ]
[Info  - 오전 8:39:53] Typechecking reverse dependencies for NormalizedFilePath "/home/scarf/repo/etc/haskell/codewars/Century.hs": [  ]
scarf005 commented 1 year ago

found out HLS 1.10.0.0 only has basic support for ghc 9.6.1 https://haskell-language-server.readthedocs.io/en/latest/support/ghc-version-support.html#current-ghc-version-support-status