clion-cppcheck icon indicating copy to clipboard operation
clion-cppcheck copied to clipboard

single line files without newline show findings as global message

Open firewave opened this issue 3 years ago • 2 comments

int f(int*p){return *p;}

image

If you add the newline at the end of the line it shows up in the Problems tab as expected.

firewave avatar Jul 25 '22 19:07 firewave

I tried using DocumentUtil.getLineTextRange() for the TextRange generation instead but it lead to the same result. So it appears this is an upstream issue. Needs more investigating.

We should still use the simplified calculation though.

firewave avatar Jul 25 '22 19:07 firewave

I tried using DocumentUtil.getLineTextRange() for the TextRange generation instead but it lead to the same result. So it appears this is an upstream issue. Needs more investigating.

We should still use the simplified calculation though.

This actually leads to the whole line (including leading whitespaces) being highlighted. So that should not be used at all.

firewave avatar Jul 27 '22 12:07 firewave