ea6f1381

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Detect TH splices by span containment, not just AST wrappers

The previous --skip-th-splices implementation only matched
XExpr (ExpandedThingTc orig expanded) where orig was a splice node.
That covers operator-style expansions, but most splices in
Yesod/Persistent codebases (mkYesodData, mkPersist [persistLowerCase|...|],
$(widgetFile ...)) are evaluated during renaming and the typechecked
AST sees the result as if it were original code, with no wrapper.

Collect splice spans from the parsed AST instead (HsUntypedSplice,
HsTypedSplice, SpliceD), store them per-module in a process-global IORef,
and in recordMutation drop any mutation whose RealSrcSpan is contained
in a splice span.

Walking the parsed AST uses Data generics so we don't have to enumerate
every AST constructor.

Suite timing

Time to Start Worker time Duration Time to finish
Config 0s 2s 2s 2s
Eval 3s 39s 39s 43s
Build 7s 1h46m22s 50m18s 50m25s
Test - - - -
Deploy - - - -
Suite 0s 1h47m05s 50m25s 50m25s

Timeline

0s1m2m3m4m5m6m7m8m9m10m11m12m13m14m15m16m17m18m19m20m21m22m23m24m25m26m27m28m29m30m31m32m33m34m35m36m37m38m39m40m41m42m43m44m45m46m47m48m49m50m