summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorMatteo Centenaro <bugant@gmail.com>2018-10-10 18:19:47 +0200
committerw0rp <w0rp@users.noreply.github.com>2018-10-10 17:19:47 +0100
commitbf1ac8e822835ac2b0e1173e1e014c773b8e51a6 (patch)
treec07810d24da1049e22910538555d4a5db2e941b3 /autoload
parentea49cc759f7254c03a3515371ffad23e6b326d07 (diff)
downloadale-bf1ac8e822835ac2b0e1173e1e014c773b8e51a6.zip
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
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/elixir.vim13
1 files changed, 13 insertions, 0 deletions
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