From bf1ac8e822835ac2b0e1173e1e014c773b8e51a6 Mon Sep 17 00:00:00 2001 From: Matteo Centenaro Date: Wed, 10 Oct 2018 18:19:47 +0200 Subject: FIX: use mix from the project root directory (#1954) * FIX: use mix from the project root directory * Move find root project function to autoloaded handlers * add tests for #ale#handlers#elixr#FindMixProjectRoot --- autoload/ale/handlers/elixir.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 autoload/ale/handlers/elixir.vim (limited to 'autoload') diff --git a/autoload/ale/handlers/elixir.vim b/autoload/ale/handlers/elixir.vim new file mode 100644 index 00000000..91b75aac --- /dev/null +++ b/autoload/ale/handlers/elixir.vim @@ -0,0 +1,13 @@ +" Author: Matteo Centenaro (bugant) - https://github.com/bugant +" +" Description: find the root directory for an elixir project that uses mix + +function! ale#handlers#elixir#FindMixProjectRoot(buffer) abort + let l:mix_file = ale#path#FindNearestFile(a:buffer, 'mix.exs') + + if !empty(l:mix_file) + return fnamemodify(l:mix_file, ':p:h') + endif + + return '.' +endfunction -- cgit v1.2.3