Open BebeSparkelSparkel opened 9 months ago
This is not a bug but a feature request.
--cmd
does handle this actually. However, I basically just don't use stack ever. If you have some guidance on what the "correct" stack invocation is, I could add a flag for it for "easy access".
+1! ghcitui
is potentially very impactful and needs more users and testers.
In your project, whether you use cabal or stack, find a command that gets you a useful GHCI prompt, then just run ghcitui --cmd 'CMD'
. It's similar to ghcid
in this way.
In simple stack projects that might be just
ghcitui --cmd 'stack ghci'
In my multi-package project, it's ghcitui --cmd 'just ghci'
, which in essence is (loading multiple packages at once):
ghcitui --cmd 'stack exec -- ghci -ihledger-lib -ihledger hledger/Hledger/Cli.hs'
Some ways of starting GHCI don't seem to work so well with ghcitui
. You should see a list of modules in the lower right Modules pane, and when you press M to focus there, select a module with up/down, and press enter to view it, you should see its source in the main pane. If so, it's good, and setting breakpoints, starting with :main
, stepping with s
etc. should work.
To clarify with:
Some ways of starting GHCI don't seem to work so well with ghcitui. You should see a list of modules in the lower right Modules pane, and when you press M to focus there, select a module with up/down, and press enter to view it, you should see its source in the main pane. If so, it's good, and setting breakpoints, starting with :main, stepping with s etc. should work.
Was this the bit that's related to #48? Just want to be sure this isn't part of the feature request for stack
support, but rather part of a bug report about module's not displaying their source in the source viewer window.
Hi @CrystalSplitter, yes I feel that's related to #48 as the symptom was the same, even though in this case there was multiple modules: selecting a module didn't show code in the main pane. I mentioned it on #30 as finding stack/cabal repl commands that avoid that seemed important. (I don't have an exact repro for you.)
Hmm. That's interesting. If you do find a reproducer with multiple modules, do let me know!
I'll put this one on the backburner while I work on adding better multithread support.
https://github.com/CrystalSplitter/ghcitui/pull/59 address the bit about how MANUAL.rst
doesn't talk about how to use --cmd
. Clarification I think there was overdue.
As for "intelligent" stack support, some ideas:
stack repl
. This works but it doesn't have any modules it seems by default. How does module detection work with stack
? I can't seem to get it to find my modules by default, and the docs seem sparse on this.fourmolu
project). But I would be interested to know your use cases.
Looking at the MANUAL.rst it seems that only
cabal repl
is supported. It would be nice to also supportstack repl
as well.Perhaps this is already supported with the
--cmd
option, but this is unclear and may just be for adding more cabal aguments.