vim-syntastic / syntastic

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

Only one character is underlined, not the whole error #2408

Open glibg10b opened 2 years ago

glibg10b commented 2 years ago

Notice that only the "i" is underlined, not "iint":

image

GCC provides -fdiagnostics-parseable-fixits which shows the start and end lines and columns:

       -fdiagnostics-parseable-fixits
           Emit fix-it hints in a machine-parseable format, suitable for consumption by IDEs.  For each fix-it, a line will be printed after the relevant diagnostic, starting with the string "fix-it:".  For example:

                   fix-it:"test.c":{45:3-45:21}:"gtk_widget_show_all"

This applies to the gcc and avrgcc cpp checkers. I didn't test any of the other ones.

lcd047 commented 2 years ago

Please note that syntastic is dead, deprecation note is in the README.

Please also note that even when syntastic was alive, nobody really cared about the C/C++ checkers. Syntastic is a general framework for putting error messages in a box; for C/C++ there are far more capable specialized plugins such as YCM.

Still, if you insist to fix this, patches are welcome. Please make sure the fix is only applied to the gcc versions that support fix-it, and that it doesn't break checking with CLang.