Skip to content

Adding types to import list includes identically named constructors. #1932

Closed
@Fybe

Description

@Fybe

Steps to reproduce

module A where

data Foo = Foo
module B where

foo :: Foo
foo = undefined

Pressing Ctrl+. on Foo in Module B and adding the missing import
adds import A (Foo(Foo)) to the import list.

Expected behaviour

Only the type name gets imported, not the constructor.

Actual behaviour

The constructor gets imported as well, even though it is not required.

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

haskell-language-server version: 1.2.0.0 (GHC: 8.10.4) (PATH: /home/finn/.config/Code/User/globalStorage/haskell.haskell/haskell-language-server-1.2.0-linux-8.10.4) (GIT hash: be2071e985cb417f984ab00a1aad76dee02d6d0b)
Tool versions found on the $PATH
cabal:		3.0.0.0
stack:		2.5.1
ghc:		8.8.4

Which OS do you use:
Fedora 34

Which lsp-client do you use:
VS Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions