showModules in the Ghcid library is mostly just a parsing wrapper around exec :show modules. However, in certain execution contexts, it returns the execution location information as a module in the given listing, e.g.:
Example from some shellcheck debugging (recovered from logs):
>>> Ghcid.exec ghci ":show modules"
["()","[shellcheck.hs:204:5-21] #~GHCID-START~#()","[shellcheck.hs:204:5-21] #~GHCID-START~#Main ( shellcheck.hs, interpreted )"]
>>> Ghcid.showModules ghci
[("[shellcheck.hs:204:5-21]","shellcheck.hs")]
-- Should be [("Main", "shellcheck.hs")]
There's a number of cases where #~GHCID-START~# seems to not be properly filtered out during execution. In my use case, this is very common, and easily worked around. However, showModules blindly parses this incorrectly.
The start up command for ghcid above was cabal v2-repl --repl-options'-fno-it', though this also happens with cabal v2-repl regardless.
showModulesin the Ghcid library is mostly just a parsing wrapper around exec:show modules. However, in certain execution contexts, it returns the execution location information as a module in the given listing, e.g.:Example from some shellcheck debugging (recovered from logs):
There's a number of cases where
#~GHCID-START~#seems to not be properly filtered out during execution. In my use case, this is very common, and easily worked around. However,showModulesblindly parses this incorrectly.The start up command for ghcid above was
cabal v2-repl --repl-options'-fno-it', though this also happens withcabal v2-replregardless.