stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

Inline comment to the last constructor disapears

Open Lev135 opened this issue 1 year ago • 1 comments

(with stylish-haskell 0.14.3.0): It happens with enums, constructor with fields and records:

data Foo
  = Foo -- ^ foo
  | Bar -- ^ bar
  | Baz -- ^ baz

data Foo'
  = Foo' Int -- ^ foo
  | Bar' Int -- ^ bar
  | Baz' Int -- ^ baz

data Foo''
  = Foo''
  { foo :: Int
  }
  -- ^ foo
  | Bar''
  { bar :: Int
  }
  -- ^ bar
  | Baz''
  { baz :: Int
  }
  -- ^ baz

after stylish:

data Foo
  = Foo -- ^ foo
  | Bar -- ^ bar
  | Baz

data Foo'
  = Foo' Int -- ^ foo
  | Bar' Int -- ^ bar
  | Baz' Int

data Foo''
  = Foo''
  { foo :: Int
  }
  -- ^ foo
  | Bar''
  { bar :: Int
  }
  -- ^ bar
  | Baz''
  { baz :: Int
  }

Lev135 avatar Nov 06 '22 14:11 Lev135