diff options
author | NiBo <nibocn@gmail.com> | 2020-05-19 10:43:16 +0800 |
---|---|---|
committer | NiBo <nibocn@gmail.com> | 2020-05-19 10:43:16 +0800 |
commit | e61e1147b0cc33039c96f9518e22363d3d63d5a9 (patch) | |
tree | d0d8ca4d1957f60fc91891e8cf582336ce0b60cb /ale_linters/java | |
parent | ff6bfc3d374706ab80d3dc40a4d3a15baffa8ad2 (diff) | |
download | ale-e61e1147b0cc33039c96f9518e22363d3d63d5a9.zip |
refactor(javac): ale_java_javac_classpath variable supports String and List types
Diffstat (limited to 'ale_linters/java')
-rw-r--r-- | ale_linters/java/javac.vim | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ale_linters/java/javac.vim b/ale_linters/java/javac.vim index 5ea40026..949733f8 100644 --- a/ale_linters/java/javac.vim +++ b/ale_linters/java/javac.vim @@ -41,10 +41,15 @@ endfunction function! s:BuildClassPathOption(buffer, import_paths) abort " Filter out lines like [INFO], etc. let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''') - call extend( - \ l:class_paths, - \ split(ale#Var(a:buffer, 'java_javac_classpath'), s:classpath_sep), - \) + let l:cls_path = ale#Var(a:buffer, 'java_javac_classpath') + + if !empty(l:cls_path) && type(l:cls_path) is v:t_string + call extend(l:class_paths, split(l:cls_path, s:classpath_sep)) + endif + + if !empty(l:cls_path) && type(l:cls_path) is v:t_list + call extend(l:class_paths, l:cls_path) + endif return !empty(l:class_paths) \ ? '-cp ' . ale#Escape(join(l:class_paths, s:classpath_sep)) |