Use _config for LSP config options
This commit is contained in:
parent
9692c0c64c
commit
681a6e371d
3 changed files with 8 additions and 8 deletions
|
@ -2,7 +2,7 @@
|
||||||
" Description: Implementation of the Language Server Protocol for R.
|
" Description: Implementation of the Language Server Protocol for R.
|
||||||
|
|
||||||
call ale#Set('r_languageserver_cmd', 'languageserver::run()')
|
call ale#Set('r_languageserver_cmd', 'languageserver::run()')
|
||||||
call ale#Set('r_languageserver_options', {})
|
call ale#Set('r_languageserver_config', {})
|
||||||
|
|
||||||
function! ale_linters#r#languageserver#GetCommand(buffer) abort
|
function! ale_linters#r#languageserver#GetCommand(buffer) abort
|
||||||
let l:cmd_string = ale#Var(a:buffer, 'r_languageserver_cmd')
|
let l:cmd_string = ale#Var(a:buffer, 'r_languageserver_cmd')
|
||||||
|
@ -19,7 +19,7 @@ endfunction
|
||||||
call ale#linter#Define('r', {
|
call ale#linter#Define('r', {
|
||||||
\ 'name': 'languageserver',
|
\ 'name': 'languageserver',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'lsp_config': {b -> ale#Var(b, 'r_languageserver_options')},
|
\ 'lsp_config': {b -> ale#Var(b, 'r_languageserver_config')},
|
||||||
\ 'executable': 'Rscript',
|
\ 'executable': 'Rscript',
|
||||||
\ 'command': function('ale_linters#r#languageserver#GetCommand'),
|
\ 'command': function('ale_linters#r#languageserver#GetCommand'),
|
||||||
\ 'project_root': function('ale_linters#r#languageserver#GetProjectRoot')
|
\ 'project_root': function('ale_linters#r#languageserver#GetProjectRoot')
|
||||||
|
|
|
@ -16,8 +16,8 @@ g:ale_r_languageserver_cmd *g:ale_r_languageserver_cmd*
|
||||||
See the languageserver documentation for more options.
|
See the languageserver documentation for more options.
|
||||||
|
|
||||||
|
|
||||||
g:ale_r_languageserver_options *g:ale_r_languageserver_options*
|
g:ale_r_languageserver_config *g:ale_r_languageserver_config*
|
||||||
*b:ale_r_languageserver_options*
|
*b:ale_r_languageserver_config*
|
||||||
Type: |Dictionary|
|
Type: |Dictionary|
|
||||||
Default: `{}`
|
Default: `{}`
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ g:ale_r_lintr_lint_package *g:ale_r_lintr_lint_package*
|
||||||
Default: `0`
|
Default: `0`
|
||||||
|
|
||||||
When set to `1`, the file will be checked with `lintr::lint_package` instead
|
When set to `1`, the file will be checked with `lintr::lint_package` instead
|
||||||
of `lintr::lint`. This prevents erroneous namespace warnings when linting
|
of `lintr::lint`. This prevents erroneous namespace warnings when linting
|
||||||
package files.
|
package files.
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@ g:ale_r_styler_options *g:ale_r_styler_options*
|
||||||
|
|
||||||
This option can be configured to change the options for styler.
|
This option can be configured to change the options for styler.
|
||||||
|
|
||||||
The value of this option will be used as the `style` argument for the
|
The value of this option will be used as the `style` argument for the
|
||||||
`styler::style_file` options. Consult the styler documentation
|
`styler::style_file` options. Consult the styler documentation
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,6 @@ Execute(The project root should be detected correctly):
|
||||||
Execute(Should accept configuration settings):
|
Execute(Should accept configuration settings):
|
||||||
AssertLSPConfig {}
|
AssertLSPConfig {}
|
||||||
|
|
||||||
let b:ale_r_languageserver_options = {'r': {'lsp': {'debug': 'true', 'diagnostics': 'true'}}}
|
let b:ale_r_languageserver_config = {'r': {'lsp': {'debug': 'true', 'diagnostics': 'true'}}}
|
||||||
|
|
||||||
AssertLSPConfig {'r': {'lsp': {'debug': 'true', 'diagnostics': 'true'}}}
|
AssertLSPConfig {'r': {'lsp': {'debug': 'true', 'diagnostics': 'true'}}}
|
||||||
|
|
Reference in a new issue