2018-03-31 10:55:20 -04:00
|
|
|
" Author: Bang Lee <https://github.com/Qusic>
|
|
|
|
" Description: clang linter for objcpp files
|
|
|
|
|
|
|
|
" Set this option to change the Clang options for warnings for ObjCPP.
|
|
|
|
if !exists('g:ale_objcpp_clang_options')
|
|
|
|
let g:ale_objcpp_clang_options = '-std=c++14 -Wall'
|
|
|
|
endif
|
|
|
|
|
|
|
|
function! ale_linters#objcpp#clang#GetCommand(buffer) abort
|
|
|
|
" -iquote with the directory the file is in makes #include work for
|
|
|
|
" headers in the same directory.
|
|
|
|
return 'clang++ -S -x objective-c++ -fsyntax-only '
|
|
|
|
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
|
|
|
\ . ' ' . ale#Var(a:buffer, 'objcpp_clang_options') . ' -'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('objcpp', {
|
|
|
|
\ 'name': 'clang',
|
|
|
|
\ 'output_stream': 'stderr',
|
|
|
|
\ 'executable': 'clang++',
|
2019-03-08 06:04:56 -05:00
|
|
|
\ 'command': function('ale_linters#objcpp#clang#GetCommand'),
|
2018-07-30 17:18:16 -04:00
|
|
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
2018-03-31 10:55:20 -04:00
|
|
|
\})
|