From 27795de05f6f72fd1bc19b6cbba287e2516f37f9 Mon Sep 17 00:00:00 2001 From: emmanueltouzery Date: Sat, 23 Dec 2023 16:37:22 +0100 Subject: [PATCH] fix(mix): invoke in the folder of the mix.exs (#241) * mix: invoke in the folder of the mix.exs * refactor: use get_mix_file helper function * lint: fix type error --------- Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com> --- lua/overseer/template/mix.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/overseer/template/mix.lua b/lua/overseer/template/mix.lua index eebbffb7..9284473f 100644 --- a/lua/overseer/template/mix.lua +++ b/lua/overseer/template/mix.lua @@ -40,12 +40,14 @@ return { end, }, generator = function(opts, cb) + -- mix will not return all the tasks unless you invoke it in the mix.exs folder + local mix_folder = vim.fs.dirname(assert(get_mix_file(opts))) local ret = {} local jid = vim.fn.jobstart({ "mix", "help", }, { - cwd = opts.dir, + cwd = mix_folder, stdout_buffered = true, on_stdout = vim.schedule_wrap(function(j, output) for _, line in ipairs(output) do