From a7ef1817b7aa06d0f80952ad530be87ad3c8f6e2 Mon Sep 17 00:00:00 2001 From: Diego Henrique Oliveira Date: Thu, 5 Sep 2024 03:37:30 -0300 Subject: Improve support for python package manage: pipenv, poetry and uv (#4825) --- ale_linters/python/pylsp.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ale_linters/python/pylsp.vim') diff --git a/ale_linters/python/pylsp.vim b/ale_linters/python/pylsp.vim index a1c31018..d3db6e82 100644 --- a/ale_linters/python/pylsp.vim +++ b/ale_linters/python/pylsp.vim @@ -6,6 +6,7 @@ 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_auto_uv', 0) call ale#Set('python_pylsp_config', {}) function! ale_linters#python#pylsp#GetExecutable(buffer) abort @@ -19,6 +20,11 @@ function! ale_linters#python#pylsp#GetExecutable(buffer) abort return 'poetry' endif + if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pylsp_auto_uv')) + \ && ale#python#UvPresent(a:buffer) + return 'uv' + endif + return ale#python#FindExecutable(a:buffer, 'python_pylsp', ['pylsp']) endfunction @@ -37,7 +43,7 @@ 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\|poetry$' + let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' \ ? ' run pylsp' \ : '' let l:env_string = '' -- cgit v1.2.3