File: clang.vim

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (23 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
" 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 '
    \   . '-iquote %s:h'
    \   . ' ' . ale#Var(a:buffer, 'objc_clang_options') . ' -'
endfunction

call ale#linter#Define('objc', {
\   'name': 'clang',
\   'output_stream': 'stderr',
\   'executable': 'clang',
\   'command': function('ale_linters#objc#clang#GetCommand'),
\   'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})