haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.61k stars 351 forks source link

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

Open dragospe opened 2 weeks ago

dragospe commented 2 weeks ago

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:

Describe alternatives you've considered

Alternatives would include:

Additional context

None

michaelpj commented 2 weeks ago

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