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

Not reload when works with -c 'ghci -x hs' #349

Open
luochen1990 opened this issue Jan 25, 2022 · 2 comments
Open

Not reload when works with -c 'ghci -x hs' #349

luochen1990 opened this issue Jan 25, 2022 · 2 comments

Comments

@luochen1990
Copy link

Reproduce:

  1. create file named test-ghcid-issue with following content:
#! /usr/bin/env nix-shell
#! nix-shell -p ghcid -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [req])" -i "ghcid -c 'ghci -Wall -x hs' -T main"

main :: IO ()
main = do
print ("hello" :: String)
  1. run ./test-ghcid-issue
  2. edit code and observe changes

Observed:

Nothing changes in step 3.

Expected:

Source file auto reload just like .hs files works.

Note:

About the ghci option -x: https://stackoverflow.com/questions/8177950/how-can-i-load-a-runhaskell-script-without-a-hs-extension-with-ghci

@ndmitchell
Copy link
Owner

Can you run with the --verbose option, which will produce a long list with all the information required to debug this. My guess is the parsing functions don't work, but could probably be adapted.

@luochen1990
Copy link
Author

Can you run with the --verbose option, which will produce a long list with all the information required to debug this. My guess is the parsing functions don't work, but could probably be adapted.

Following is the output with --verbose enabled:

%TESTING: main
%STDIN: main
%STDIN:
INTERNAL_GHCID.putStrLn ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','3','2','~','#']
INTERNAL_GHCID.hPutStrLn INTERNAL_GHCID.stderr ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','3','2','~','#']
%WAITING: /data/ws/issues/.ghcid /data/ws/dotfiles/home/.ghci /data/ws/issues/github-ghcid-349
%WAITING: /data/ws/dotfiles/home /data/ws/issues
%STDOUT: #~GHCID-START~##~GHCID-START~#"hello"
"hello"
%STDOUT: #~GHCID-START~##~GHCID-START~##~GHCID-FINISH-32~#
%STDERR: #~GHCID-FINISH-32~#
%TESTING: Completed

...done

I don't understand the meanning, but the number 32 changed everytime the file is edited and saved

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

2 participants