Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language.Haskell.Ghcid showModules incorrectly parses context information as module names (GHCi 9.4.4) #382

Open
CrystalSplitter opened this issue Oct 2, 2023 · 0 comments

Comments

@CrystalSplitter
Copy link

CrystalSplitter commented Oct 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant