diff options
author | NiBo <nibocn@gmail.com> | 2020-05-18 17:35:16 +0800 |
---|---|---|
committer | NiBo <nibocn@gmail.com> | 2020-05-19 10:41:35 +0800 |
commit | ff6bfc3d374706ab80d3dc40a4d3a15baffa8ad2 (patch) | |
tree | 2f1c496bb4ddbc256a4d1bed33290e630ba99e37 /ale_linters/java | |
parent | 3635285c022ebaa0fe3d54ca74cac1207dda555b (diff) | |
download | ale-ff6bfc3d374706ab80d3dc40a4d3a15baffa8ad2.zip |
refactor(javac): ale_java_javac_sourcepath variable supports String and List types
Diffstat (limited to 'ale_linters/java')
-rw-r--r-- | ale_linters/java/javac.vim | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ale_linters/java/javac.vim b/ale_linters/java/javac.vim index 928f555f..5ea40026 100644 --- a/ale_linters/java/javac.vim +++ b/ale_linters/java/javac.vim @@ -80,11 +80,20 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths, meta) abort endif endif - let l:sourcepath_item = ale#Var(a:buffer, 'java_javac_sourcepath') + let l:source_paths = [] + let l:source_path = ale#Var(a:buffer, 'java_javac_sourcepath') - if !empty(l:sourcepath_item) - for l:sourcepath in l:sourcepath_item - let l:sp_path = ale#path#FindNearestDirectory(a:buffer, l:sourcepath) + if !empty(l:source_path) && type(l:source_path) is v:t_string + let l:source_paths = split(l:source_path, s:classpath_sep) + endif + + if !empty(l:source_path) && type(l:source_path) is v:t_list + let l:source_paths = l:source_path + endif + + if !empty(l:source_paths) + for l:path in l:source_paths + let l:sp_path = ale#path#FindNearestDirectory(a:buffer, l:path) if !empty(l:sp_path) call add(l:sp_dirs, l:sp_path) |