Does Intero not have a feature like this already? It seems like we have all the info available to at least provide this as a web service for in-snapshot packages. The module-to-package relation is 1 to 1 most of the time.
On Dec 19, 2017 6:57 AM, "Michael Snoyman" <[email protected]> wrote: > I can't think of an easy way to do it. It will come down to: > > * Looking up which package the module came from (likely in the GHC package > database) > * Figuring out if it's in the snapshot or local (the `stack query` command > may help here) > * Finding the relevant source code, checking hs-source-dirs in the cabal > file, and looking for the file in question > > On Mon, Dec 18, 2017 at 11:43 PM, Csaba Hruska <[email protected]> > wrote: > >> Hi, >> >> I am experimenting with a tool and I need some help or advice. >> Assuming a stack based project what is the simplest way to retrieve the >> source code for a module from the module name? >> The module source code should be the same that GHC used when compiled the >> project. >> I'd like to retrieve the source code for both local and stackage modules. >> >> Thanks, >> Csaba Hruska >> >> -- >> You received this message because you are subscribed to the Google Groups >> "haskell-stack" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/haskell-stack/6c05584e-a4c1-463d-bb64-5cbc83ef93e0%40googlegroups.com >> <https://groups.google.com/d/msgid/haskell-stack/6c05584e-a4c1-463d-bb64-5cbc83ef93e0%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "haskell-stack" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/haskell-stack/CAKA2JgJUBO8oDaFK0uwc4RSkEuT9U > MPF8QpdKP1ToLBOfV-BFA%40mail.gmail.com > <https://groups.google.com/d/msgid/haskell-stack/CAKA2JgJUBO8oDaFK0uwc4RSkEuT9UMPF8QpdKP1ToLBOfV-BFA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "haskell-stack" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/CALSygwcXUKG-VGtA%3D-o2s%3Du1Bhht8wyCWUPm%3DWy6oGHFRyBQhQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
