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

VSCode: Cannot find "Watch Ghcid output" command #239

Closed
Rizary opened this issue Apr 17, 2019 · 16 comments · Fixed by #313
Closed

VSCode: Cannot find "Watch Ghcid output" command #239

Rizary opened this issue Apr 17, 2019 · 16 comments · Fixed by #313

Comments

@Rizary
Copy link

Rizary commented Apr 17, 2019

I tried running haskell project which create ghcid-output.txt and follow the instructions:
Open ghcid.txt in VS Code as the active editor. Run the VS Code command (Ctrl+Shift+P) named "Watch Ghcid output".

but I can't find the watch ghcid output

Does the command still there?

@ndmitchell
Copy link
Owner

This was removed in 9bd2a47. I should have cleaned up the documentation too. Although I'm wondering why it was removed, since that would have been rather handy for me some of the time. Were you hoping to use it? What's your use case for it? If so, I'll reinstate it and release.

@Rizary
Copy link
Author

Rizary commented Apr 19, 2019

Hi @ndmitchell, so right now I am using obelisk project in my windows machine (WSL) and want to develop using VSCode installed in my windows. So whenever we run ob watch, it generates ghcid-output.txt and watch ghcid output is needed in this case iirc.

moreover, it has been discussed in obsidiansystems/obelisk#184 (comment) also.

@srid
Copy link

srid commented Apr 19, 2019

I have been using this feature actually (when using vscode). ob run basically does a bunch of things and delegates to ghcid (configuring it to output to a file called ghcid-output.txt), and I run ob run on terminal (outside of vscode).

@srid
Copy link

srid commented Apr 19, 2019

Slightly off-topic: I'd love to have this feature on Emacs (which is what I use right now) as well. :-)

@Rizary
Copy link
Author

Rizary commented Apr 20, 2019

@srid that is good to hear. I think this feature is very useful.

@ndmitchell
Copy link
Owner

Have you seen the ghcid command setting? If you set that to ob run then starting Ghcid might work properly,. Would that be an easier route?

@aveltras
Copy link

Would be nice to have this option back. The problem faced here is when you have to enter a specific environment with nix or direnv for example which default "Start ghcid" doesn't seem to handle well. The watch option seems good to have since it's pretty environment agnostic relative to the way to generate the ghcid.txt.

@srid
Copy link

srid commented Jul 12, 2019

Have you seen the ghcid command setting? If you set that to ob run then starting Ghcid might work properly,. Would that be an easier route?

@ndmitchell That setting doesn't seem to know how to run complex CLI like the following (which I use in a non-obelisk project):

nix-shell default.nix --run "cd example; ghcid -c 'ghci -Wall -i../src  Main.hs' -T 'Rib.App.dev Main.settings' --reload=Main.hs"

image

@srid
Copy link

srid commented Jul 12, 2019

The watch option seems good to have since it's pretty environment agnostic relative to the way to generate the ghcid.txt.

Yea. And sometimes I do want to leave ghcid running in a terminal inside tmux, so that I can reattach to my project environment from elsewhere without being tied to VScode.

@srid
Copy link

srid commented Jul 12, 2019

That setting doesn't seem to know how to run complex CLI like the following

Okay I am able to work around this issue by putting the long CLI in a script file, and then using that script file in the vscode settings. Works now! (However I don't see error inlines; but that's outside the scope of this issue ...)

@ndmitchell
Copy link
Owner

I think the tmux argument is compelling. Definitely something to add back. PR welcome, or I'll get to it one day.

@srid
Copy link

srid commented Jul 16, 2019

Great! I wonder if we should resurrect this feature but provide a somewhat different (arguably improved) UX. That is:

  • Have the user run ghcid writing to (say) ghcid-output.txt at project root (in fact, obelisk does this by default, without the user having to do anything; so ob run generates this file automatically)
  • Have the user configure the VScode extension to specify "${projectroot}/ghcid-output.txt" as the filepath to ghcid output (instead of the executable path to ghcid itself, which would be the alternative option)

Then the extension can work automatically by reading the configured file, instead of the user having to manually open the said file.

Just a suggestion, though.

@ndmitchell
Copy link
Owner

Makes a lot of sense @srid - I still like the menu entry "open with this file" (since that's the primitive), but having configuration options that let everyone just "start ghcid" makes a lot of sense. PR most welcome.

@endgame
Copy link

endgame commented Jan 29, 2020

I think having ghcid watch file output solves another problem - trying to start ghcid once and for all in a single project is often not possible. The test suite usually has a different set of dependencies, and ghcid gets confused. In emacs-land, where I usually work, I have to tell my ghcid integration to use a different target based on the directory the source file is in.

@ndmitchell
Copy link
Owner

All sounds great. Patches welcome. I suspect I'm not likely to get to this in the near term, since I've stopped using the ghcid extension in favour of ghcide where I can (somewhat to dogfood ghcide).

@chrismwendt
Copy link
Contributor

Fix pending in #313

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

Successfully merging a pull request may close this issue.

6 participants