Fix #1608 - Treat .h as C++ files for C++ clang-tidy

This commit is contained in:
w0rp
2020-08-10 02:33:50 +01:00
parent 2237f9b462
commit d3f410b6f7
2 changed files with 6 additions and 0 deletions

View File

@@ -25,6 +25,11 @@ function! ale_linters#cpp#clangtidy#GetCommand(buffer, output) abort
let l:options .= !empty(l:options) ? ale#Pad(l:cflags) : l:cflags
endif
" Tell clang-tidy a .h header with a C++ filetype in Vim is a C++ file.
if expand('#' . a:buffer) =~# '\.h$'
let l:options .= !empty(l:options) ? ' -x c++' : '-x c++'
endif
" Get the options to pass directly to clang-tidy
let l:extra_options = ale#Var(a:buffer, 'cpp_clangtidy_extra_options')