Skip to content

Auto import doesn't work in some cases #2238

@Akhristenko

Description

@Akhristenko

Your environment

haskell-language-server version: 1.4.0.0 (GHC: 8.10.7) (GIT hash: 253547816ee216c53ee7dacc0ad3cac43e863d30)
Tool versions found on the $PATH
cabal:          3.4.0.0
stack:          2.7.3
ghc:            8.10.4

Which OS do you use: Ubuntu 20.04
Which lsp-client do you use: VSCode

Steps to reproduce

  • create new project with stack and latest resolver (LTS 18.10 for ghc-8.10.7)
  • in this project add mtl to dependencies of executable
  • build project and open Main.hs
  • in end of the file typing rc = runC, invoke autocomplete and select runCont from Control.Monad.Cont. After that line with import Control.Monad.Cont (runCont) will be added on start of the file.
  • in end of the file typing c = con, invoke autocomplete and select cont from Control.Monad.Cont

Expected behaviour

hls modify import list to import Control.Monad.Cont (runCont, cont)

Actual behaviour

import list remain import Control.Monad.Cont (runCont)

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: imports plugintype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions