From 40bf6e6b5c2cd8e5e23141254fa9f8bee5e6cd84 Mon Sep 17 00:00:00 2001 From: Horacio Sanson Date: Wed, 19 Jun 2019 11:38:23 +0900 Subject: Add support for javalsp configuration options. This MR adds a new configuration variable `g:ale_java_javalsp_config` that allows to configure external dependencies and class paths to the language server. The variable accepts a dictionary similar to the one supported by the [vscode/settings.json](https://github.com/georgewfraser/java-language-server#settings) file. Deprecates: #2561 --- .../test_javalsp_command_callback.vader | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'test/command_callback') diff --git a/test/command_callback/test_javalsp_command_callback.vader b/test/command_callback/test_javalsp_command_callback.vader index ca7388c0..122f409b 100644 --- a/test/command_callback/test_javalsp_command_callback.vader +++ b/test/command_callback/test_javalsp_command_callback.vader @@ -29,3 +29,52 @@ Execute(The javalsp callback should return backward compatible value): \] AssertLinter '/bin/java', join(cmd, ' ') +Execute(The javalsp should have default config): + AssertEqual + \ { + \ 'java': { + \ 'classPath': [], + \ 'externalDependencies': [] + \ } + \ }, + \ ale_linters#java#javalsp#Config(bufnr('')) + +Execute(The javalsp should have default config if user sets empty hash): + let b:ale_java_javalsp_config = {} + + AssertEqual + \ { + \ 'java': { + \ 'classPath': [], + \ 'externalDependencies': [] + \ } + \ }, + \ ale_linters#java#javalsp#Config(bufnr('')) + +Execute(The javalsp should have add missing config): + let b:ale_java_javalsp_config = { 'java': { 'classPath': ['aaa.jar'] } } + + AssertEqual + \ { + \ 'java': { + \ 'classPath': ['aaa.jar'], + \ 'externalDependencies': [] + \ } + \ }, + \ ale_linters#java#javalsp#Config(bufnr('')) + + let b:ale_java_javalsp_config = + \ { + \ 'java': { + \ 'externalDependencies': ['unit-test:2.0.0'] + \ } + \ } + + AssertEqual + \ { + \ 'java': { + \ 'classPath': [], + \ 'externalDependencies': ['unit-test:2.0.0'] + \ } + \ }, + \ ale_linters#java#javalsp#Config(bufnr('')) -- cgit v1.2.3