1
0
Fork 0
mirror of synced 2024-11-15 13:38:58 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/tex/texlab.vim

27 lines
959 B
VimL
Raw Normal View History

2019-08-22 11:36:17 -04:00
" Author: Ricardo Liang <ricardoliang@gmail.com>
2021-05-31 16:30:26 -04:00
" Author: ourigen <https://github.com/ourigen>
2019-08-22 11:36:17 -04:00
" Description: Texlab language server (Rust rewrite)
call ale#Set('tex_texlab_executable', 'texlab')
call ale#Set('tex_texlab_options', '')
2022-05-19 09:16:38 -04:00
call ale#Set('tex_texlab_config', {})
2019-08-22 11:36:17 -04:00
function! ale_linters#tex#texlab#GetProjectRoot(buffer) abort
2021-05-05 04:25:00 -04:00
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
2019-08-22 11:36:17 -04:00
endfunction
function! ale_linters#tex#texlab#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'tex_texlab_options'))
endfunction
call ale#linter#Define('tex', {
\ 'name': 'texlab',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'tex_texlab_executable')},
\ 'command': function('ale_linters#tex#texlab#GetCommand'),
\ 'project_root': function('ale_linters#tex#texlab#GetProjectRoot'),
2022-05-19 09:16:38 -04:00
\ 'lsp_config': {b -> ale#Var(b, 'tex_texlab_config')},
2019-08-22 11:36:17 -04:00
\})