mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Added automatic compile-commands-dir arg to ale_cpp_clangd linter
This commit is contained in:
@@ -5,7 +5,11 @@ call ale#Set('cpp_clangd_executable', 'clangd')
|
|||||||
call ale#Set('cpp_clangd_options', '')
|
call ale#Set('cpp_clangd_options', '')
|
||||||
|
|
||||||
function! ale_linters#cpp#clangd#GetCommand(buffer) abort
|
function! ale_linters#cpp#clangd#GetCommand(buffer) abort
|
||||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'cpp_clangd_options'))
|
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) : '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
|
|||||||
Reference in New Issue
Block a user