summaryrefslogtreecommitdiff
path: root/ale_linters/c
diff options
context:
space:
mode:
authorMurfalo <howdy@murfalo.com>2019-10-09 13:30:10 -0400
committerMurfalo <howdy@murfalo.com>2019-10-09 13:30:10 -0400
commit35f51221f1519c591a6d26a8d8acd12388deab50 (patch)
tree439817c68210a909c5ae26b5c8df6148c978628f /ale_linters/c
parent618f2d71fcfb13b99f221de6c47120c572a912d8 (diff)
downloadale-35f51221f1519c591a6d26a8d8acd12388deab50.zip
Updated ale_linters/c/clangd.vim to match ale_linters/cpp/clangd.vim
Diffstat (limited to 'ale_linters/c')
-rw-r--r--ale_linters/c/clangd.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/ale_linters/c/clangd.vim b/ale_linters/c/clangd.vim
index 79b600fa..5ca30973 100644
--- a/ale_linters/c/clangd.vim
+++ b/ale_linters/c/clangd.vim
@@ -5,7 +5,11 @@ call ale#Set('c_clangd_executable', 'clangd')
call ale#Set('c_clangd_options', '')
function! ale_linters#c#clangd#GetCommand(buffer) abort
- return '%e' . ale#Pad(ale#Var(a:buffer, 'c_clangd_options'))
+ let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
+
+ return '%e'
+ \ . ale#Pad(ale#Var(a:buffer, 'c_clangd_options'))
+ \ . (!empty(l:build_dir) ? ' -compile-commands-dir=' . ale#Escape(l:build_dir) : '')
endfunction
call ale#linter#Define('c', {