summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorMatteo Centenaro <bugant@gmail.com>2018-10-10 18:19:47 +0200
committerw0rp <devw0rp@gmail.com>2018-10-10 17:23:21 +0100
commit96d84aec8f95d3b67c29a16111b48914ead74e59 (patch)
tree770192907668e2bb0fd12a3cbaefc1a1835e49ba /autoload
parent143c3cd09f52996c90b78059275a400d3c2327b0 (diff)
downloadale-96d84aec8f95d3b67c29a16111b48914ead74e59.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