Closed turbotimon closed 1 year ago
Thanks for the report; can you post the respective .cabal
file and the GHC version you are using?
sure i added all above
Thanks for the update! Sadly, I can't seem to be able to reproduce this on x86_64-linux using GHC 9.2 and HLS 1.9.0.0 from nixpkgs :thinking:
One potential reason could be that HLS somehow tells Ormolu to use GHC2021
(which implies ImportQualifiedPost
) instead of Haskell2010
(which you specify in the .cabal
file). As GHC2021
was added in GHC 9.2 as the default language, it would be interesting whether you can reproduce it with GHC 9.0 (but don't feel obligated in any way to do this, purely optional).
If you just want to get your code to compile, you can add
{-# LANGUAGE ImportQualifiedPost #-}
to the modules in question; but that is of course just a workaround.
Thanks for your detailed answer, i will have a deeper look into it as soon as i find time. for the moment its the workaround
Describe the bug When i format this code
It gets formatted to this
leading to compile errors
To Reproduce
v2.2.2
> Format Document
Expected behavior
A formatter should not format my code in a way it doesn't compile anymore (ImportQualifiedPost seems not to be standard compiler behaviour)
Environment
Additional context
Changing the formatter in the plugin, e.g. to floskell does solve the problem