Add PyLS linter (#1097)

* Support PyLS (python language server)
* Replace pyls#GetProjectRoot and add more config types to ale#python#FindProjectRoot
This commit is contained in:
Auri
2017-11-08 19:58:56 +02:00
committed by w0rp
parent 86e8074017
commit 8a4cf923a8
5 changed files with 35 additions and 2 deletions

View File

@@ -0,0 +1,21 @@
" Author: aurieh <me@aurieh.me>
" Description: A language server for Python
call ale#Set('python_pyls_executable', 'pyls')
function! ale_linters#python#pyls#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'python_pyls_executable')
endfunction
function! ale_linters#python#pyls#GetLanguage(buffer) abort
return 'python'
endfunction
call ale#linter#Define('python', {
\ 'name': 'pyls',
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#python#pyls#GetExecutable',
\ 'command_callback': 'ale_linters#python#pyls#GetExecutable',
\ 'language_callback': 'ale_linters#python#pyls#GetLanguage',
\ 'project_root_callback': 'ale#python#FindProjectRoot',
\})