Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

HsImport inserts module between function and Haddock documentation. #1228

@fendor

Description

@fendor

Has been reported upstream hsimport/#16. We have to wait for a new release, then this issue can be closed.

Example is roughly taken from stack new test haskeleton
Example.hs

-- | An example module.
module Example (main) where

-- | An example function.
main :: IO ()
main = return ()

foo :: IO ()
foo = do
    _ <- async $ return ()
    return ()
> hsimport -m "Control.Concurrent.Async" Example.hs

Output:

-- | An example module.
module Example (main) where

-- | An example function.
import Control.Concurrent.Async
main :: IO ()
main = return ()

foo :: IO ()
foo = do
    _ <- async $ return ()
    return ()

Expected:

-- | An example module.
module Example (main) where

import Control.Concurrent.Async
-- | An example function.
main :: IO ()
main = return ()

foo :: IO ()
foo = do
    _ <- async $ return ()
    return ()

Happens when using the code action to import a module.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions