summaryrefslogtreecommitdiff
path: root/ale_linters/python/pylsp.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/python/pylsp.vim')
-rw-r--r--ale_linters/python/pylsp.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/python/pylsp.vim b/ale_linters/python/pylsp.vim
index 4c6ac16d..537d1e74 100644
--- a/ale_linters/python/pylsp.vim
+++ b/ale_linters/python/pylsp.vim
@@ -5,6 +5,7 @@ call ale#Set('python_pylsp_executable', 'pylsp')
call ale#Set('python_pylsp_options', '')
call ale#Set('python_pylsp_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pylsp_auto_pipenv', 0)
+call ale#Set('python_pylsp_auto_poetry', 0)
call ale#Set('python_pylsp_config', {})
function! ale_linters#python#pylsp#GetExecutable(buffer) abort
@@ -13,13 +14,18 @@ function! ale_linters#python#pylsp#GetExecutable(buffer) abort
return 'pipenv'
endif
+ if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pylsp_auto_poetry'))
+ \ && ale#python#PoetryPresent(a:buffer)
+ return 'poetry'
+ endif
+
return ale#python#FindExecutable(a:buffer, 'python_pylsp', ['pylsp'])
endfunction
function! ale_linters#python#pylsp#GetCommand(buffer) abort
let l:executable = ale_linters#python#pylsp#GetExecutable(a:buffer)
- let l:exec_args = l:executable =~? 'pipenv$'
+ let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylsp'
\ : ''