From 35f51221f1519c591a6d26a8d8acd12388deab50 Mon Sep 17 00:00:00 2001 From: Murfalo Date: Wed, 9 Oct 2019 13:30:10 -0400 Subject: Updated ale_linters/c/clangd.vim to match ale_linters/cpp/clangd.vim --- ale_linters/c/clangd.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ale_linters/c') 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', { -- cgit v1.2.3 From a62f26434ac68eaddea7642201ddf0335e91d384 Mon Sep 17 00:00:00 2001 From: Murfalo Date: Wed, 9 Oct 2019 13:40:04 -0400 Subject: Added tests for clangd compile commands dectection --- ale_linters/c/clangd.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'ale_linters/c') diff --git a/ale_linters/c/clangd.vim b/ale_linters/c/clangd.vim index 5ca30973..c42d4497 100644 --- a/ale_linters/c/clangd.vim +++ b/ale_linters/c/clangd.vim @@ -3,6 +3,7 @@ call ale#Set('c_clangd_executable', 'clangd') call ale#Set('c_clangd_options', '') +call ale#Set('c_build_dir', '') function! ale_linters#c#clangd#GetCommand(buffer) abort let l:build_dir = ale#c#GetBuildDirectory(a:buffer) -- cgit v1.2.3