google / google/haskell-indexer
Index post-processed sources
- Dominant language
- Haskell
- Stars
- 103
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
Brought up by @mpickering. A few things to sort out for that question:
- Does GHC provide convenient access to the post-processed ASTs, ideally with post-processed spans?
- If not, are the post-processed sources accessible and can we do an extra compilation for them to get the spans?
- How would we deduplicate definitions/references that are present in both the original and post-processed sources? (Sidenote: IIRC GhcAnalyser drops references that originated from generated code, but not sure if TH falls under that condition).
- Where would we place post-processed code (this is a valid question for CPP too)? Kythe supports virtual roots, and generally we can emit whatever code fragments we want anywhere in the tree, but it would have to be thought up what reference/generates/... edges would be present.
- Would we emit full postprocessed sources (more problematic duplication-wise), or do some smart thing to just put the TH-generated source fragments in virtual files?
+@creachadair: does for example the Kythe C++ indexer emit virtual fragments for un-CPP-d code? Do you have any takeaways from earlier attempts on this topic?
Contributor guide
Assessment
This issue has not been assessed yet.