Skip to content
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

Package load path #497

Open
NobbZ opened this issue Mar 20, 2019 · 6 comments
Open

Package load path #497

NobbZ opened this issue Mar 20, 2019 · 6 comments

Comments

@NobbZ
Copy link

NobbZ commented Mar 20, 2019

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.

@jsoo1
Copy link
Contributor

jsoo1 commented Mar 23, 2019 via email

@andylokandy
Copy link

andylokandy commented Apr 17, 2019

Hi @jsoo1, the work on elba side to support plugin integration is done (elba/elba#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:

  1. check whether an elba.toml manifest exists in project root, if it does, check whether elba program is available, and if they are all good, switch from ipkg mode to elba mode.
  2. In elba mode, use elba repl --ide-mode instead of idris --ide-mode.
  3. Watch elba.toml and elba.lock, and reload elba repl --ide-moe if file got changed.

@NobbZ
Copy link
Author

NobbZ commented Apr 17, 2019

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.

@andylokandy
Copy link

andylokandy commented Apr 17, 2019

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.

@andylokandy
Copy link

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.

@jsoo1
Copy link
Contributor

jsoo1 commented Apr 17, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants