Skip to content

Adding imports adds an extra comma #2958

Closed
@cdsmith

Description

@cdsmith

It is legal in Haskell to write an import list like this:

import Foo
  ( a,
    b,
    c,
  )

Note the trailing comma. In particular, Ormolu formats files this way. However, if I have an import list formatted this way, and ask HLS to add an import (for example, from the quick-actions list, or otherwise auto-importing something), I get this

import Foo
  ( a,
    b,
    c,, newImport
  )

Note the double comma at the end. Of course, this is a syntax error.

Metadata

Metadata

Assignees

Labels

component: ghcidetype: 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