diff options
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/java/javalsp.vim | 22 | ||||
-rw-r--r-- | ale_linters/ruby/solargraph.vim | 19 |
2 files changed, 41 insertions, 0 deletions
diff --git a/ale_linters/java/javalsp.vim b/ale_linters/java/javalsp.vim new file mode 100644 index 00000000..f335e83c --- /dev/null +++ b/ale_linters/java/javalsp.vim @@ -0,0 +1,22 @@ +" Author: Horacio Sanson <https://github.com/hsanson> +" Description: Support for the Java language server https://github.com/georgewfraser/vscode-javac + +call ale#Set('java_javalsp_jar', 'javacs.jar') + +function! ale_linters#java#javalsp#Executable(buffer) abort + return 'java' +endfunction + +function! ale_linters#java#javalsp#Command(buffer) abort + let l:jar = ale#Var(a:buffer, 'java_javalsp_jar') + return ale#Escape('java -cp ' . l:jar . ' -Xverify:none org.javacs.Main') +endfunction + +call ale#linter#Define('java', { +\ 'name': 'javalsp', +\ 'lsp': 'stdio', +\ 'executable_callback': 'ale_linters#java#javalsp#Executable', +\ 'command_callback': 'ale_linters#java#javalsp#Command', +\ 'language': 'java', +\ 'project_root_callback': 'ale#java#FindProjectRoot', +\}) diff --git a/ale_linters/ruby/solargraph.vim b/ale_linters/ruby/solargraph.vim new file mode 100644 index 00000000..a53bcaa3 --- /dev/null +++ b/ale_linters/ruby/solargraph.vim @@ -0,0 +1,19 @@ +" Author: Horacio Sanson - https://github.com/hsanson +" Description: Solargraph Language Server https://solargraph.org/ + +call ale#Set('ruby_solargraph_host', '127.0.0.1') +call ale#Set('ruby_solargraph_port', '7658') + +function! ale_linters#ruby#solargraph#GetAddress(buffer) abort + let l:host = ale#Var(a:buffer, 'ruby_solargraph_host') + let l:port = ale#Var(a:buffer, 'ruby_solargraph_port') + return l:host . ':' . l:port +endfunction + +call ale#linter#Define('ruby', { +\ 'name': 'solargraph', +\ 'lsp': 'socket', +\ 'address_callback': 'ale_linters#ruby#solargraph#GetAddress', +\ 'language': 'ruby', +\ 'project_root_callback': 'ale#ruby#FindProjectRoot' +\}) |