use mix for elixir

This commit is contained in:
Ely Arzhannikov 2013-02-23 18:01:44 +06:00
parent 182b3f01c0
commit a5024b1176

View File

@ -14,12 +14,22 @@ if exists("g:loaded_syntastic_elixir_elixir_checker")
endif endif
let g:loaded_syntastic_elixir_elixir_checker=1 let g:loaded_syntastic_elixir_elixir_checker=1
let s:syntastic_elixir_compile_command = 'elixir'
if filereadable("mix.exs")
let s:syntastic_elixir_compile_command = "mix compile"
endif
function! SyntaxCheckers_elixir_elixir_IsAvailable() function! SyntaxCheckers_elixir_elixir_IsAvailable()
if s:syntastic_elixir_compile_command == 'elixir'
return executable('elixir') return executable('elixir')
else
return executable('mix')
endif
endfunction endfunction
function! SyntaxCheckers_elixir_elixir_GetLocList() function! SyntaxCheckers_elixir_elixir_GetLocList()
let makeprg = syntastic#makeprg#build({ 'exe': 'elixir' }) let makeprg = syntastic#makeprg#build({ 'exe': s:syntastic_elixir_compile_command })
let errorformat = '** %*[^\ ] %f:%l: %m' let errorformat = '** %*[^\ ] %f:%l: %m'
let elixir_results = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) let elixir_results = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })