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
This commit is contained in:
Matteo Centenaro
2018-10-10 18:19:47 +02:00
committed by w0rp
parent ea49cc759f
commit bf1ac8e822
8 changed files with 50 additions and 16 deletions

View File

@@ -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