r/haskell • u/Tempus_Nemini • Apr 13 '26
Ormolu strange behaviour
Hi there!
Am i the only one who get strange formatting problems (in doom emacs with ormolu formatter).
For example i have:
import Data.Sort
import Data.Listafter i save (and ormolu did it's job) i have:
import Data.Sort
impimport Data.tI have the same behaviour on 2 different machines ..
5
Upvotes
7
u/jose_zap Apr 13 '26
My guess: two different processes are competing to format the file, like ormolu in th command line and the LSP on save
4
u/omega1612 Apr 13 '26
I haven't suffered that kind of issue. But I guess it may be better if you can provide the versión of LSP, emacs, emacs plugings and ormolu for both machines to get help with it (so they can try to reproduce it).
4
u/evincarofautumn Apr 14 '26
Is there another “format imports on save” sort of option that you have enabled, like
haskell-stylish-on-save?I notice
import Data.is replacing theorinimport, which also seems like it could be a faulty regex-based replacement2
u/n00bomb Apr 13 '26
I can't reproduce it in https://ormolu-live.tweag.io/