ModuleInfo.minf_rdr_env not exposed
a.pelenitsyn at gmail.com
Tue Aug 6 20:20:22 UTC 2019
I think the thing you propose hardly qualifies as a new feature (in the
sense of page you referenced), so not much of a hassle should be involved.
As long as it is a 3-lines change, I'd say go ahead and create an Issue and
an MR on Gitlab: you might be better off with getting feedback there.
On Tue, 6 Aug 2019 at 15:52, Sam Halliday <sam.halliday at gmail.com> wrote:
> I would like to submit a patch to ghc 8.8 adding a function that exposes a
> field that is useful for tooling authors and can already be reached, albeit
> in a very awkward way.
> The process documented at
> seems very heavyweight for the patch that I was planning to propose,
> which is just adding the following to GHC.hs (and exporting it):
> modInfoRdrEnv :: ModuleInfo -> Maybe GlobalRdrEnv
> modInfoRdrEnv = minf_rdr_env
> Without this accessor, we must reparse and typecheck the file to get the
> GlobalRdrElts, which is very inefficient and uses fields named "internal"
> so I'm guessing that's not a good thing to build a tool on top of.
> My colleague already wrote a tool using a workaround, see
> How should I go about submitting this? Do I need to write a test or is
> this trivial enough not to bother?
> Sam Halliday <sam.halliday at gmail.com> writes:
> > Hi all,
> > Is there a reason why minf_rdr_env (a field in ModuleInfo) is not
> > exposed?
> > It's possible to reconstruct it in 8.4.4 (the only version I'm looking
> > at) with a TypecheckedModule via
> > let (tc_gbl_env, _) = GHC.tm_internals_ tmod
> > minf_rdr_env = tcg_rdr_env tc_gbl_env
> > It's a useful thing to have for editor tooling (e.g. to get the correct
> > qualified imported symbols that may be autocompleted).
> > --
> > Best regards,
> > Sam
> Best regards,
> ghc-devs mailing list
> ghc-devs at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs