The Haskell Refactorer now makes use of the GHC API to load and typecheck the code to be refactored.
It uses ghc-mod internally to identify a project cabal file, and extract the targets in it.
The current code attempts to load all the targets into the module graph, to make sure that when a project is refactored the ancillary parts such as tests and benchmarks are refactored too, e.g. when renaming a function.
The problem is that GHC is unable to load more than one main file.