From fa19bca80e742eb1ea8498bf48f75a3fb886c539 Mon Sep 17 00:00:00 2001 From: puritys Date: Thu, 26 Mar 2020 06:40:07 +0000 Subject: To support javaagent on eclipselsp --- ale_linters/java/eclipselsp.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'ale_linters/java/eclipselsp.vim') diff --git a/ale_linters/java/eclipselsp.vim b/ale_linters/java/eclipselsp.vim index 2648893b..2e472cfc 100644 --- a/ale_linters/java/eclipselsp.vim +++ b/ale_linters/java/eclipselsp.vim @@ -7,6 +7,7 @@ call ale#Set('java_eclipselsp_path', ale#path#Simplify($HOME . '/eclipse.jdt.ls' call ale#Set('java_eclipselsp_config_path', '') call ale#Set('java_eclipselsp_workspace_path', '') call ale#Set('java_eclipselsp_executable', 'java') +call ale#Set('java_eclipselsp_javaagent', '') function! ale_linters#java#eclipselsp#Executable(buffer) abort return ale#Var(a:buffer, 'java_eclipselsp_executable') @@ -100,12 +101,28 @@ function! ale_linters#java#eclipselsp#WorkspacePath(buffer) abort return ale#path#Dirname(ale#java#FindProjectRoot(a:buffer)) endfunction +function! ale_linters#java#eclipselsp#Javaagent(buffer) abort + let l:rets = [] + let l:raw = ale#Var(a:buffer, 'java_eclipselsp_javaagent') + if empty(l:raw) + return '' + endif + + let l:jars = split(l:raw) + for l:jar in l:jars + call add(l:rets, ale#Escape('-javaagent:' . l:jar)) + endfor + + return join(l:rets, ' ') +endfunction + function! ale_linters#java#eclipselsp#Command(buffer, version) abort let l:path = ale#Var(a:buffer, 'java_eclipselsp_path') let l:executable = ale_linters#java#eclipselsp#Executable(a:buffer) let l:cmd = [ ale#Escape(l:executable), + \ ale_linters#java#eclipselsp#Javaagent(a:buffer), \ '-Declipse.application=org.eclipse.jdt.ls.core.id1', \ '-Dosgi.bundles.defaultStartLevel=4', \ '-Declipse.product=org.eclipse.jdt.ls.core.product', -- cgit v1.2.3 From 9edefa724b87805ed05246362173f2f5c6285793 Mon Sep 17 00:00:00 2001 From: puritys Date: Thu, 26 Mar 2020 07:54:12 +0000 Subject: Fix code convention --- ale_linters/java/eclipselsp.vim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ale_linters/java/eclipselsp.vim') diff --git a/ale_linters/java/eclipselsp.vim b/ale_linters/java/eclipselsp.vim index 2e472cfc..2bfec043 100644 --- a/ale_linters/java/eclipselsp.vim +++ b/ale_linters/java/eclipselsp.vim @@ -104,11 +104,13 @@ endfunction function! ale_linters#java#eclipselsp#Javaagent(buffer) abort let l:rets = [] let l:raw = ale#Var(a:buffer, 'java_eclipselsp_javaagent') + if empty(l:raw) return '' endif let l:jars = split(l:raw) + for l:jar in l:jars call add(l:rets, ale#Escape('-javaagent:' . l:jar)) endfor -- cgit v1.2.3