Skip to content

Extend imports broken when more than one option #864

Closed
@pepeiborra

Description

@pepeiborra

Description: ghcide cannot handle GHC error messages suggesting more than one import to be extended:

• Variable not in scope:
    intercalate :: [Char] -> [[Char]] -> String
• Perhaps you want to add ‘intercalate’
  to one of these import lists:
    ‘Data.List’ (/home/pepe/scratch/testbox/MyLib.hs:3:1-19)
    ‘GHC.OldList’ (/home/pepe/scratch/testbox/MyLib.hs:4:1-21)

Expected behavior - the following code actions:

  • Add 'intercalate' to the import list of GHC.OldList
  • Add 'intercalate' to the import list of Data.List

Actual behavior - the following code actions which result in duplicate imports:

  • import GHC.OldList (intercalate)
  • import Data.List (intercalate)

Full code:

module MyLib where
import Data.List ()
import GHC.OldList ()

someFunc :: IO ()
someFunc = putStrLn $ intercalate " " ["hi", "world"]

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