#2919 Use compile_commands.json for headers

This commit is contained in:
w0rp
2020-08-10 02:14:23 +01:00
parent 05210846e4
commit 2237f9b462
4 changed files with 14 additions and 20 deletions

View File

@@ -9,13 +9,6 @@ let s:sep = has('win32') ? '\' : '/'
let g:__ale_c_project_filenames = ['.git/HEAD', 'configure', 'Makefile', 'CMakeLists.txt']
function! ale#c#GetBuildDirectory(buffer) abort
" Don't include build directory for header files, as compile_commands.json
" files don't consider headers to be translation units, and provide no
" commands for compiling header files.
if expand('#' . a:buffer) =~# '\v\.(h|hpp)$'
return ''
endif
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
" c_build_dir has the priority if defined