summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorpinicarus <pinicarus@protonmail.com>2020-11-01 11:45:36 +0100
committerpinicarus <pinicarus@protonmail.com>2020-11-01 11:45:36 +0100
commitdb96b007209f7ea0983c58cb1d18771f5a45a543 (patch)
tree092fb643e078359c8e8356c41fc7cb50ceb355e7 /ale_linters
parentd7557ef9be6ce680e811e31e217db5624d9e2897 (diff)
parent62f2c6d3261af41ef01db6868724881fd6eebccc (diff)
downloadale-db96b007209f7ea0983c58cb1d18771f5a45a543.zip
Merge branch 'custom-erlc-executable'
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/erlang/erlc.vim16
-rw-r--r--ale_linters/java/javac.vim8
2 files changed, 13 insertions, 11 deletions
diff --git a/ale_linters/erlang/erlc.vim b/ale_linters/erlang/erlc.vim
index a83bacc3..e78dc341 100644
--- a/ale_linters/erlang/erlc.vim
+++ b/ale_linters/erlang/erlc.vim
@@ -1,14 +1,22 @@
" Author: Magnus Ottenklinger - https://github.com/evnu
+let g:ale_erlang_erlc_executable = get(g:, 'ale_erlang_erlc_executable', 'erlc')
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
+function! ale_linters#erlang#erlc#GetExecutable(buffer) abort
+ return ale#Var(a:buffer, 'erlang_erlc_executable')
+endfunction
+
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
let l:output_file = ale#util#Tempname()
call ale#command#ManageFile(a:buffer, l:output_file)
- return 'erlc -o ' . ale#Escape(l:output_file)
- \ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
- \ . ' %t'
+ let l:command = ale#Escape(ale_linters#erlang#erlc#GetExecutable(a:buffer))
+ \ . ' -o ' . ale#Escape(l:output_file)
+ \ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
+ \ . ' %t'
+
+ return l:command
endfunction
function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
@@ -90,7 +98,7 @@ endfunction
call ale#linter#Define('erlang', {
\ 'name': 'erlc',
-\ 'executable': 'erlc',
+\ 'executable': function('ale_linters#erlang#erlc#GetExecutable'),
\ 'command': function('ale_linters#erlang#erlc#GetCommand'),
\ 'callback': 'ale_linters#erlang#erlc#Handle',
\})
diff --git a/ale_linters/java/javac.vim b/ale_linters/java/javac.vim
index f866eb09..a5e57e6c 100644
--- a/ale_linters/java/javac.vim
+++ b/ale_linters/java/javac.vim
@@ -9,13 +9,7 @@ call ale#Set('java_javac_classpath', '')
call ale#Set('java_javac_sourcepath', '')
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
- let l:command = ''
- let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
-
- if !empty(l:pom_path) && executable('mvn')
- let l:command = ale#path#CdString(fnamemodify(l:pom_path, ':h'))
- \ . 'mvn dependency:build-classpath'
- endif
+ let l:command = ale#maven#BuildClasspathCommand(a:buffer)
" Try to use Gradle if Maven isn't available.
if empty(l:command)