Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dragospe opened this issue Jun 8, 2024 · 1 comment
Labels
type: enhancement New feature or request

Comments

@dragospe
Copy link

dragospe commented Jun 8, 2024

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

@michaelpj
Copy link
Collaborator

cc @jetjinser, I think this could be another nice use for inlay hints!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants