Haskell-language-server: Suggest new open imports

Created on 27 Aug 2020  路  3Comments  路  Source: haskell/haskell-language-server

It would be nice if in addition to closed (or qualified) imports HLS would suggest adding an open import for a missing symbol.

As far as I can tell this is the only bit which would need to change: https://github.com/jneira/ghcide/blob/f4f575dbdd0cf37fc60d2a11215cb35368d3a334/src/Development/IDE/Plugin/CodeAction.hs#L749-L767

Indiscriminate open imports are certainly not a good thing, but here and there they can be useful.

I'm pretty sure HIE used to suggest these.

ghcide enhancement

Most helpful comment

All 3 comments

Ah, I realize that this should probably have been opened against ghcide

+1 for it, since one can now make import list closed afterwards with the newly added import lense feature.

It is more desirable if it could automatically generate the hiding clause if there are some symbol collisions with already imported ones.

Was this page helpful?
0 / 5 - 0 ratings