Skip to content

Add ctor to import list code action broken with ghc 9.2 #2662

Closed
@guibou

Description

@guibou

Add to import list code action is broken with GHC 9.2, because it does not includes comma between symbols:

HLSAddImportMissingComa

Your environment

Which OS do you use: Linux
Which LSP client (editor/plugin) do you use: Neovim + lsp_config
Describe your project (alternative: link to the project): standalone file

Steps to reproduce

Test with the following file:

import Data.List.NonEmpty (fromList)

a = case fromList [1,2,3] of
      a :| l -> "boo"

Error should complain about :| not being in scope, and a code action should propose to add :| to the import list of Data.List.NonEmpty. You can execute the code action.

Expected behaviour

Code action should change the import list to something valid, such as (fromList, NonEmpty((:|))).

Actual behaviour

Executing the code action changes the import list from (fromList) to (fromListNonEmpty((:|)) effectively missing the comma, generating a parse error.

Include debug information

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