Closed
Description
Your environment
Output of haskell-language-server --probe-tools
or haskell-language-server-wrapper --probe-tools
:
haskell-language-server version: 1.0.0.0 (GHC: 8.10.2) (PATH: /nix/store/b3jr5z4hzv4vsysi0g7r1dx2a9ndi1ja-haskell-language-server-1.0.0.0/bin/haskell-language-server-wrapper)
Tool versions found on the $PATH
cabal: 3.4.0.0
stack: 2.5.1.1
ghc: 8.10.2
Which OS do you use: NixOS
Which lsp-client do you use: emacs
Steps to reproduce
When filling in a typed hole in a class method with a lambda case split, the whole instance head/decl gets reformatted. This project has stylish-haskell setup and does not touch instances.
Expected behaviour
Use the code formatter or not touch the instance head.
E.g., for this code:
instance
( Cast (GBoolExp b a) (GBoolExp b' a')
, Cast a a'
) => Cast (GBoolExp b a) (GBoolExp b' a') where
cast = _
When doing "lambda case split" on the _
, I get this:
instance (Cast (GBoolExp b a) (GBoolExp b' a'), Cast a a') =>
Cast (GBoolExp b a) (GBoolExp b' a') where
cast
= \case
(BoolAnd l_gb'a') -> _
(BoolOr l_gb'a') -> _
(BoolNot gb'a') -> _
(BoolExists gb'a') -> _
(BoolFld a') -> _
What I would expect is this:
instance
( Cast (GBoolExp b a) (GBoolExp b' a')
, Cast a a'
) => Cast (GBoolExp b a) (GBoolExp b' a') where
cast
= \case
(BoolAnd l_gb'a') -> _
(BoolOr l_gb'a') -> _
(BoolNot gb'a') -> _
(BoolExists gb'a') -> _
(BoolFld a') -> _