-
Notifications
You must be signed in to change notification settings - Fork 90
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
GHCi/repl support? #450
Comments
hi @goldfirere, nice to read you here 🙂 Quoting @alanz:
It has even a sketch of the design of the feature, but nobody has tackled it 😟 |
Perhaps there could be a VS code command (for the vscode-haskell plugin only, outside of the scope of LSP) that opens up a new terminal and calls |
Thanks for the responses. If it's helpful, I've filed haskellfoundation/tech-proposals#11 requesting Haskell Foundation attention / resources here, as I think supporting developer tooling, in general, is one of the more impactful ways the HF could help us all. |
hmm that could work but it would need some work here, which will become obsolete after support in the server. So it would depend on how much time would cost to make the workaround here 😺 |
That is exactly what the debug adapter protocol (DAP) allows. The key is to get the DAP session talking to the same HLS server, which then manages context and an interpreter. And I have always had the idea that the external interpreter can help here, as you can run it with separate stdio pipes using a hook, and then it runs in its own process, separate from the HLS/GHC session. We are doing something similar in the erlang language server. |
So support for DAP and repl could come together? that sounds great |
Yes, and you potentially have a lot of options as to where you run the REPL too, based on launch configurations which are user configurable. And as I pointed out before, there is already DAP support for GHC, using the Phoityne VSCode extension. Which means the protocol implementation in haskell for the GHC side already exists. The pieces should be to adapt that to run under HLS using the external interpreter, and orchestrating things so that both the LSP and DAP sessions talk to the same executable. |
Well i think we could close this one and keep it only in the server |
Apologies if I've just missed a piece of documentation, but I'm wondering if there's a way to load an open file into GHCi.
Context: I'm switching to VSCode from emacs, where my usual workflow involves loading into GHCi several times every minute. With HLS giving me quick feedback, this isn't so necessary in VSCode, but it's still sometimes nice. (Example: sometimes I might want to see an error with
-fprint-explicit-kinds
enabled.)I can, of course, open a terminal and run GHCi there. But this is still not quite as convenient as I'd like. Now, to load, I have to save my file, switch to the terminal window, reload, and then (perhaps) switch back to my file.
Is there a better way? If not, can this be a feature request to add one?
Thanks!
The text was updated successfully, but these errors were encountered: