Skip to content

Import identifier sometimes inserts in the wrong place #98

@mpilgrem

Description

@mpilgrem

If there are no existing import lines in the module, the command Haskell: Import identifier inserts import ... directly after the line module ... and not after the where line.

For example (based on a simple test stack new test project, selecting the IO identifier and picking base System.IO -- data IO a from the options provided by the command)

module Lib
    ( someFunc
    ) where

someFunc :: IO ()
someFunc = putStrLn "someFunc"

becomes:

module Lib
import System.IO
    ( someFunc
    ) where

someFunc :: IO ()
someFunc = putStrLn "someFunc"

rather than (say):

module Lib
    ( someFunc
    ) where
import System.IO

someFunc :: IO ()
someFunc = putStrLn "someFunc"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions