mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-10 06:21:53 +08:00
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
This commit is contained in:
@@ -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(''))
|
||||
|
||||
Reference in New Issue
Block a user