All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
2 " Description: https://github.com/pappasam/jedi-language-server
4 call ale#Set('python_jedils_executable', 'jedi-language-server')
5 call ale#Set('python_jedils_use_global', get(g:, 'ale_use_global_executables', 0))
6 call ale#Set('python_jedils_auto_pipenv', 0)
7 call ale#Set('python_jedils_auto_poetry', 0)
8 call ale#Set('python_jedils_auto_uv', 0)
10 function! ale_linters#python#jedils#GetExecutable(buffer) abort
11 if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_jedils_auto_pipenv'))
12 \ && ale#python#PipenvPresent(a:buffer)
16 if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_jedils_auto_poetry'))
17 \ && ale#python#PoetryPresent(a:buffer)
21 if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_jedils_auto_uv'))
22 \ && ale#python#UvPresent(a:buffer)
26 return ale#python#FindExecutable(a:buffer, 'python_jedils', ['jedi-language-server'])
29 function! ale_linters#python#jedils#GetCommand(buffer) abort
30 let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer)
31 let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
32 \ ? ' run jedi-language-server'
36 if ale#Var(a:buffer, 'python_auto_virtualenv')
37 let l:env_string = ale#python#AutoVirtualenvEnvString(a:buffer)
40 return l:env_string . ale#Escape(l:executable) . l:exec_args
43 call ale#linter#Define('python', {
45 \ 'aliases': ['jedi_language_server'],
47 \ 'executable': function('ale_linters#python#jedils#GetExecutable'),
48 \ 'command': function('ale_linters#python#jedils#GetCommand'),
49 \ 'project_root': function('ale#python#FindProjectRoot'),
50 \ 'completion_filter': 'ale#completion#python#CompletionItemFilter',