summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
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