mirror of https://github.com/dense-analysis/ale
Merge pull request #2230 from yut23/master
Add support for pyls configuration options
This commit is contained in:
commit
bffb26cb72
|
@ -4,6 +4,7 @@
|
|||
call ale#Set('python_pyls_executable', 'pyls')
|
||||
call ale#Set('python_pyls_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('python_pyls_auto_pipenv', 0)
|
||||
call ale#Set('python_pyls_config', {})
|
||||
|
||||
function! ale_linters#python#pyls#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyls_auto_pipenv'))
|
||||
|
@ -31,4 +32,5 @@ call ale#linter#Define('python', {
|
|||
\ 'command_callback': 'ale_linters#python#pyls#GetCommand',
|
||||
\ 'project_root_callback': 'ale#python#FindProjectRoot',
|
||||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
||||
\ 'lsp_config_callback': ale#VarFunc('python_pyls_config'),
|
||||
\})
|
||||
|
|
|
@ -494,6 +494,24 @@ g:ale_python_pyls_auto_pipenv *g:ale_python_pyls_auto_pipenv*
|
|||
if true. This is overridden by a manually-set executable.
|
||||
|
||||
|
||||
g:ale_python_pyls_config *g:ale_python_pyls_config*
|
||||
*b:ale_python_pyls_config*
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
Dictionary with configuration settings for pyls. For example, to disable
|
||||
the pycodestyle linter: >
|
||||
{
|
||||
\ 'pyls': {
|
||||
\ 'plugins': {
|
||||
\ 'pycodestyle': {
|
||||
\ 'enabled': v:false
|
||||
\ }
|
||||
\ }
|
||||
\ },
|
||||
\ }
|
||||
<
|
||||
|
||||
===============================================================================
|
||||
pyre *ale-python-pyre*
|
||||
|
||||
|
|
|
@ -45,3 +45,8 @@ Execute(Pipenv is detected when python_pyls_auto_pipenv is set):
|
|||
|
||||
AssertLinter 'pipenv',
|
||||
\ ale#Escape('pipenv') . ' run pyls'
|
||||
|
||||
Execute(Should accept configuration settings):
|
||||
AssertLSPConfig {}
|
||||
let b:ale_python_pyls_config = {'pyls': {'plugins': {'preload': {'enabled': v:false}}}}
|
||||
AssertLSPConfig {'pyls': {'plugins': {'preload': {'enabled': v:false}}}}
|
||||
|
|
Loading…
Reference in New Issue