From a5024b1176b887f4416aa11a560787dd0682f1c9 Mon Sep 17 00:00:00 2001 From: Ely Arzhannikov Date: Sat, 23 Feb 2013 18:01:44 +0600 Subject: [PATCH 1/2] use mix for elixir --- syntax_checkers/elixir/elixir.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/syntax_checkers/elixir/elixir.vim b/syntax_checkers/elixir/elixir.vim index 93bca4d4..ae8e449c 100644 --- a/syntax_checkers/elixir/elixir.vim +++ b/syntax_checkers/elixir/elixir.vim @@ -14,12 +14,22 @@ if exists("g:loaded_syntastic_elixir_elixir_checker") endif 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() - return executable('elixir') + if s:syntastic_elixir_compile_command == 'elixir' + return executable('elixir') + else + return executable('mix') + endif endfunction 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 elixir_results = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) From 9d7b358d3dd663c1d3d491e5f1cb53dfcb8c6d3e Mon Sep 17 00:00:00 2001 From: Ely Arzhannikov Date: Sun, 24 Feb 2013 19:16:06 +0600 Subject: [PATCH 2/2] always return list --- syntax_checkers/elixir/elixir.vim | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/syntax_checkers/elixir/elixir.vim b/syntax_checkers/elixir/elixir.vim index ae8e449c..453bab5e 100644 --- a/syntax_checkers/elixir/elixir.vim +++ b/syntax_checkers/elixir/elixir.vim @@ -16,8 +16,8 @@ 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" +if filereadable('mix.exs') + let s:syntastic_elixir_compile_command = 'mix compile' endif function! SyntaxCheckers_elixir_elixir_IsAvailable() @@ -32,11 +32,7 @@ function! SyntaxCheckers_elixir_elixir_GetLocList() let makeprg = syntastic#makeprg#build({ 'exe': s:syntastic_elixir_compile_command }) let errorformat = '** %*[^\ ] %f:%l: %m' - let elixir_results = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) - - if !empty(elixir_results) - return elixir_results - endif + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({