This breaks for whatever reason only on hackage. It appears
ghcid depends on fsnotify as an executable, but not as a
library. We're not using it as an executable, but perhaps
the documentation is breaking on it. I'm uncertain why
we're building the executable dependencies, but until that's
fixed we can't do anything except either downgrade text
or force upgrade fsnotify.
This commit removes Ghcitui.Ghcid.Daemon.run and replaces it with
Ghcitui.Ghcid.Daemon.threadUnsafeRun, which does the same thing
but has a more appropriate name.
Also rewrite Ghcitui.Ghcid.Daemon.schedule to be actually thread
safe and compatible with Ghcitui.Ghcid.Daemon.scheduleWithCb.
Update the module docs accordingly.
This is a full rewrite of how event handling works for Daemon interaction.
The new design flow schedules execution to the Daemon on their own thread,
waiting to acquire a lock through an MVar primitive. This ensures that
interaction with the Ghcid handle is done synchronously, while still
allowing interrupts.
We're making use of Brick's Bounded Channels, which allow asynchronous
message passing to the Brick application itself. Messaging passing must
now be done through the CustomAppEvent.
This is feature complete but there's a lot of clean up that still
must be done before this should land.
This moves a lot of the logic out of Brick.Events, to make
it easier to isolate which module parts are shared, and which
parts are specific to individual event handlers.
This commit fixes a bug where the source viewer will not display
the source code when there's only one module available. It specifically
prevents viewing that source code because it had the file already
selected--but hadn't refreshed the source window contents.
On start up, call `setSelectedFile` first to load the source window
contents.
Issue originally reported in:
https://github.com/CrystalSplitter/ghcitui/issues/48
Trying to install ghcitui on a minimal system
made me realise that `libncurses-dev` is an unlisted
dependency of `vty`.
Also follow restructured text guidelines on headings.
Originally, SourceWindow was built around a start and an end point.
It turns out, this was a bad idea as it caused update issues when
switching files.
Now we keep around the extent information.
This provides the GHCi Repl inside GHCiTUI with basic tab completion.
This is slightly more advanced than the standard GHCi tab completion,
but not by much.
This commit also moves around some error and parsing code to help
in this effort.
Co-authored-by: CrystalSplitter <crystal@crystalwobsite.gay>