Skip to content

Add option to fully expand explicit import list (import Foo (Bar (..)) -> import Foo (Bar (Baz))) #4287

Open
@dragospe

Description

@dragospe

Is your enhancement request related to a problem? Please describe.

Currently, the "make imports explicit" option produces something like

import Foo <import Foo (bar, Baz (..))>`

producing an import list like

import Foo (bar, Baz (..))`

I (personally) prefer a fully explicit import list -- one that imports all data constructors.
The primary reason is because it can help greatly in tracking down in-scope names when code is broken and tooling fails.

Thus, I'd prefer

import Foo (bar, Baz (Qux))

Describe the solution you'd like

I would like to see:

  • An (preferably default) option to do a fully-explicit import for all data constructors
  • An option (I think these are called lenses or inlay hints?) to turn partially explicit (Bar (..)) imports to fully explicit ones

Describe alternatives you've considered

Alternatives would include:

  • making this a non-default option,
  • providing only the two-step behavior of "make partially explicit (Bar (..)); make fully explicit (Bar(Baz))

Additional context

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions