1
0
Fork 0
mirror of synced 2024-11-18 14:55:34 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/objc/clang.vim

24 lines
820 B
VimL
Raw Normal View History

" Author: Bang Lee <https://github.com/Qusic>
" Description: clang linter for objc files
" Set this option to change the Clang options for warnings for ObjC.
if !exists('g:ale_objc_clang_options')
let g:ale_objc_clang_options = '-std=c11 -Wall'
endif
function! ale_linters#objc#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 '
2020-12-04 16:15:32 -05:00
\ . '-iquote %s:h'
\ . ' ' . ale#Var(a:buffer, 'objc_clang_options') . ' -'
endfunction
call ale#linter#Define('objc', {
\ 'name': 'clang',
\ 'output_stream': 'stderr',
\ 'executable': 'clang',
2019-03-08 06:04:56 -05:00
\ 'command': function('ale_linters#objc#clang#GetCommand'),
2018-07-30 17:18:16 -04:00
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})