diff options
author | Bjorn Neergaard <bjorn@neersighted.com> | 2018-11-29 14:57:35 -0700 |
---|---|---|
committer | Bjorn Neergaard <bjorn@neersighted.com> | 2018-11-29 14:57:35 -0700 |
commit | d2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch) | |
tree | bb8145e69bf1bcb8968b29cb1a68c47ceb83674d /ale_linters/cpp/clang.vim | |
parent | ef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff) | |
parent | 0a384a49d371838903d8401c5358ec60f3f4266d (diff) | |
download | ale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip |
Merge branch 'master' into sridhars
Diffstat (limited to 'ale_linters/cpp/clang.vim')
-rw-r--r-- | ale_linters/cpp/clang.vim | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ale_linters/cpp/clang.vim b/ale_linters/cpp/clang.vim index e8d96187..649c5993 100644 --- a/ale_linters/cpp/clang.vim +++ b/ale_linters/cpp/clang.vim @@ -4,29 +4,24 @@ call ale#Set('cpp_clang_executable', 'clang++') call ale#Set('cpp_clang_options', '-std=c++14 -Wall') -function! ale_linters#cpp#clang#GetExecutable(buffer) abort - return ale#Var(a:buffer, 'cpp_clang_executable') -endfunction - function! ale_linters#cpp#clang#GetCommand(buffer, output) abort let l:cflags = ale#c#GetCFlags(a:buffer, a:output) " -iquote with the directory the file is in makes #include work for " headers in the same directory. - return ale#Escape(ale_linters#cpp#clang#GetExecutable(a:buffer)) - \ . ' -S -x c++ -fsyntax-only ' - \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' ' - \ . l:cflags - \ . ale#Var(a:buffer, 'cpp_clang_options') . ' -' + return '%e -S -x c++ -fsyntax-only' + \ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) + \ . ale#Pad(l:cflags) + \ . ale#Pad(ale#Var(a:buffer, 'cpp_clang_options')) . ' -' endfunction call ale#linter#Define('cpp', { \ 'name': 'clang', \ 'output_stream': 'stderr', -\ 'executable_callback': 'ale_linters#cpp#clang#GetExecutable', +\ 'executable_callback': ale#VarFunc('cpp_clang_executable'), \ 'command_chain': [ \ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'}, \ {'callback': 'ale_linters#cpp#clang#GetCommand'}, \ ], -\ 'callback': 'ale#handlers#gcc#HandleGCCFormat', +\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes', \}) |