vim-syntastic / syntastic

Syntax checking hacks for vim
Do What The F*ck You Want To Public License
11.3k stars 1.14k forks source link

strange behavior of loc_list related to `g:syntastic_cpp_checkers` #2412

Open starsareintherose opened 1 year ago

starsareintherose commented 1 year ago

my vimrc

" syntastic config
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_loc_list_height = 4
let g:syntastic_cpp_checkers = ["clang++"]

when I use this and put the compile_commands.json under the src dir, it won't show any loc_list, only like

image

If I rm let g:syntastic_cpp_checkers = ["clang++"]

It will be like this

image

However, if there is no error, if I left let g:syntastic_cpp_checkers = ["clang++"] out, it would be like this

image

No error, but shows loc_list.

Basic Info

lcd047 commented 1 year ago

Syntastic is dead, you might consider using ALE instead.

Even when it was alive syntastic was a general framework, it was never great at checking C/C++. Specialized plugins such as YCM would make a lot more sense.

Still, if you insist on using syntastic: there is no such thing as a checker clang++, there is only gcc. To enable checking by clang++ you need to set the list of checker to gcc, and set syntastic_cpp_compiler to clang++.