HIE using ideclImplicit
Brandon Allbery
allbery.b at gmail.com
Sun Aug 11 02:50:21 UTC 2024
I've been sitting on a potential proposal to enable per-import disabling of
-Wunused-imports and -Wmissing-import-lists for a while now, and
https://mail.haskell.org/pipermail/haskell-cafe/2024-August/136852.html has
me thinking of moving forward with it.
It turns out that this would be very easy to implement within ghc, as the
ideclImplicit field of ideclExt (itself a field of ImportDecl) already does
what's needed; it exists to track the implicit Prelude import, and would be
almost trivial to set when parsing an import. I did a check to see if
anything used it as a proxy for "this is the Prelude", and everything that
wants that explicitly looks for the Prelude module, with one exception: HIE
information excludes anything from an import with ideclImplicit set.
My questions are:
1. Is this (omitting imports with ideclImplicit) even sane? What happens
with HIE information when Prelude definitions are used in the module?
2. Is this use of ideclImplicit going to cause problems with my proposed
use?
2a. Should HIE be checking explicitly for Prelude as other things do, or is
it more correct for other imports with ideclImplicit set to be treated the
same way?
--
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20240810/b415ebf6/attachment.html>
More information about the ghc-devs
mailing list