idris-mode
idris-mode copied to clipboard
Package load path
I'm trying to set up emacs and idris working together with elba
package manager.
There they have told me, to let idris search for packages in target/deps
based on my project dir.
I hoped I could set a variable that holds idris package load path, such that this variable + idris-load-packages
in a .dir-locals.el
would help me.
But I can not find a variable that I could use to actually define the path that the internally started idris would use to look packages up.
Hi there, thanks for looking into elba support! I think you might need to start by looking at idris-ipkg-mode.el
and see what it provides. Then figure out what should be done to support elba from there.
On Mar 20, 2019, at 4:45 AM, Norbert Melzer [email protected] wrote:
I'm trying to set up emacs and idris working together with elba package manager.
There they have told me, to let idris search for packages in target/deps based on my project dir.
I hoped I could set a variable that holds idris package load path, such that this variable + idris-load-packages in a .dir-locals.el would help me.
But I can not find a variable that I could use to actually define the path that the internally started idris would use to look packages up.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hi @jsoo1, the work on elba side to support plugin integration is done (https://github.com/elba/elba/issues/43), and now it's pretty simple to enable it in idris-mode for emacs.
The main feature of elba for this is elba repl --ide-mode
which can be used as a drop-in replacement for idris compiler. Elba will fetch dependency packages and build them and finally listen to stdin just like what idris compiler does. (--ide-mode-socket
is also supported)
Any other parameters like --indent-with
can be passed to idris compiler after a --
. For example elba repl --ide-mode -- --indent-with 4
.
I think we can implement the integration as the these steps:
- check whether an
elba.toml
manifest exists in project root, if it does, check whetherelba
program is available, and if they are all good, switch from ipkg mode to elba mode. - In elba mode, use
elba repl --ide-mode
instead ofidris --ide-mode
. - Watch
elba.toml
andelba.lock
, and reloadelba repl --ide-moe
if file got changed.
I'd prefer if we just could swap out the Idris executable and setup some watches via config in for locals, this would make integration for other dependency managers a matter of them impleting the wrapper instead of Idris mode implementing support for their lock files.
I like this idea. It also gives users control of what package manager to use. It might have drawback that we have to generalize the ipkg watch as well, which might cause backward compatibility problem. I think making *.ipkg
to be default watch option can solve it.
One more step forward: we can let the wrapper do the watch. Then the only thing we need is a toggle that can disable ipkg. Of course, the wrapper can ignore the -p
input and nothing have to change.
Yes I like the idea of having an interface for various package managers or build tools to implement, too. I think, though, that not much change will be required if Elba wants to own the compile step, too. I think it might be a matter of implementing the functions that pass arguments to the compiler and changing the idris binary name variable.