michaelb/sniprun

(no output) for elixir file

cassepipe opened this issue · 2 comments

Trying to evaluate a line in a elixir (.ex or .exs) file shows (no output)

echo "x = 42" > file.ex1
lvim -c "normal V" -c ":SnipRun" file.ex 

I expected a 42 as iex would output

The plugin is functional and has the expected behaviour for a python file

LunarVim 1.4
Fedora 40

iex is the REPL interpreter for Elixir right ? Sniprun uses iex when the REPL mode is enabled in for elixir ( repl_enable = {"Elixir_original"} ), in which case your example does output 42.

Otherwise, sniprun uses elixir under the hood, which doesn't outputs 42 when it runs a file containing the shown code..

Python may behave differently ofc (printing on stdout the result of the last assignment is a choice made by the interpreter's authors, not me)

Haaa it all makes sense now. I expected iex to be the default.

Also I probably read the documentation poorly because I have tried repl_enable = {"iex"} and repl_enable = {"elixir"}

Thanks for taking the time to reply. (And for crafting this plugin)