Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stylish-haskell deletes Haddock export list documentation #466

Open
dcoutts opened this issue Sep 26, 2023 · 1 comment
Open

stylish-haskell deletes Haddock export list documentation #466

dcoutts opened this issue Sep 26, 2023 · 1 comment

Comments

@dcoutts
Copy link

dcoutts commented Sep 26, 2023

Best explained by example.

Given this bit of module export list:

    -- * Table handles
  , TableHandle
  , TableConfig (..)
  , new
  , close
    -- ** Resource management
    -- $resource-management

    -- * Table queries and updates
    -- ** Queries
  , lookups
  , LookupResult (..)

stylish-haskell wants to delete these three lines entirely

    -- ** Resource management
    -- $resource-management

This is obviously wrong. That section heading and corresponding bit of documentation is important. It must not be deleted.

But also, the trailing blank line there is necessary syntax. Without it, haddock will merge the subsequent section in, rather than giving it its own section name "Table queries and updates".

$ stylish-haskell --version
stylish-haskell 0.14.5.0
@dcoutts
Copy link
Author

dcoutts commented Sep 26, 2023

Another example. It looks like it accepts such sections at the end of the export list like:

    -- * Utility types
  , IOLike
    -- * Resource management
    -- $resource-management
  ) where

however if one uses more than one section at the end, then it wants to delete all but the final one. So an example like this gets mangled:

    -- * Utility types
  , IOLike
    -- * Concurrency
    -- $concurrency

    -- * Resource management
    -- $resource-management
  ) where

It'll again delete the concurrency section.

dcoutts added a commit to IntersectMBO/lsm-tree that referenced this issue Sep 26, 2023
It mangles the haddock sections.
See haskell/stylish-haskell#466

And fix one whitespace issue stylish-haskell found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant