summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHoracio Sanson <horacio@allm.net>2019-06-19 11:38:23 +0900
committerHoracio Sanson <horacio@allm.net>2019-06-19 11:38:23 +0900
commit40bf6e6b5c2cd8e5e23141254fa9f8bee5e6cd84 (patch)
tree42c404afca7e2818bd3b5ce3cbf33cea9d34404c /test
parent1c71da5624fc46107cda4852add08fe34385dfd9 (diff)
downloadale-40bf6e6b5c2cd8e5e23141254fa9f8bee5e6cd84.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_javalsp_command_callback.vader49
1 files changed, 49 insertions, 0 deletions
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(''))