1
0
Fork 0
mirror of synced 2024-12-27 09:03:21 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/cpp/clangd.vim

23 lines
773 B
VimL
Raw Normal View History

2018-08-25 12:13:42 -04:00
" Author: Andrey Melentyev <andrey.melentyev@protonmail.com>
" Description: Clangd language server
call ale#Set('cpp_clangd_executable', 'clangd')
call ale#Set('cpp_clangd_options', '')
2019-11-16 10:28:42 -05:00
call ale#Set('c_build_dir', '')
2018-08-25 12:13:42 -04:00
function! ale_linters#cpp#clangd#GetCommand(buffer) abort
2019-11-16 10:28:42 -05:00
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'cpp_clangd_options'))
\ . (!empty(l:build_dir) ? ' -compile-commands-dir=' . ale#Escape(l:build_dir) : '')
2018-08-25 12:13:42 -04:00
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'clangd',
\ 'lsp': 'stdio',
2019-03-08 06:04:56 -05:00
\ 'executable': {b -> ale#Var(b, 'cpp_clangd_executable')},
\ 'command': function('ale_linters#cpp#clangd#GetCommand'),
2019-08-22 11:36:17 -04:00
\ 'project_root': function('ale#c#FindProjectRoot'),
2018-08-25 12:13:42 -04:00
\})