Closed saep closed 9 years ago
Note that the basis for this plugin is already there: ConfigHelper
What still has to be done is (at least) the following:
~/.config/nvim
(this will also require to implement the registration of autocmds)The second point of the list is almost implemented (although untested) in PR #22 if anyone is interested in closing this issue.
Mostly implemented with 64d05b97a264b7ba0becb083337aa30a78190e6e. Closing now as there will only be missing features which may not be too relevant.
Although the
dyre
library helps with (somewhat) dynamic recompilation, it is still a bit annoying to use. Compile errors are silently dumped into~/.cache/nvim/errors.log
and you do not really notice if something went wrong there. Say you are developing a function for a plugin, the function may fail because you did something wrong logically or because it did not compile. It would be a tremendous improvement to be notified about the latter situation immediately. Also, it is still very inconvenient to restart neovim all the time if you change the configuration. To remedy these problems, we should extend nvim-hs to supply some functions and commands out of the box. This issue is a place to collect ideas and document the stage of its development.The first steps are:
Implement a way to recompile nvim-hs.
This is probably best done by subscribing to a notification (via vim_subscribe) on startup and implement a handler for it. Currently, notifications are ignored in the SocketReader. The dyre library has some lower level functions for this, so that we do not have to spawn external processes ourselves. The quickfix list should then be filled with the compiler warnings and errors. We can parse the output in Haskell ourselves or steal that code from somewhere else (e.g. syntastic/ghc-mod).
Implement a way to restart nvim-hs.
This should probably be implemented similarly to the previous step. The dyre library has a module for this as well. This leads us to another decision: Do we want to preserve state when restarting? And if so, how should we go about it? XMonad has an extensible state state extension which we could use as inspiration for partially preserving state, but we can simply not care for now and defer this.
Then, we must think about how this is integrated within neovim. I think it is sufficient to provide two commands for the two steps above:
:RecompileNvim-hs
and:RestartNvim-hs
(feel free to suggest better names). If we define them on our side, we don't even have to explicitly callvim_subscribe
and can pass it directly to the EventHandler.