Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display "Problems" only for the code I changed/added in Visual Studio Code?

After 3 years on VS, I decided to try Visual Code with clangd for a bit. I work for a big company with huge legacy code and technical debt so I often have to work with some old code and not so modern C++ and more often than not I must read a lot of code rather than write some.

Visual code's code analysis finds hundreds of "Problems" aka warnings fill my entire page which reduces code visibility. Minimap is unusable as 80% is highlighted in yellow.

Is there a way to filter the code analysis so that it only checks and shows warning for the code I just wrote ?

I tried tweaking the user settings of the Code Analysis / clang tidy

like image 285
Krustibat Avatar asked Jun 24 '26 21:06

Krustibat


1 Answers

I'm not aware of a way to do this currently, but this has been raised in the clangd issue tracker here:

https://github.com/clangd/clangd/issues/822

Based on this comment, the conclusion seems to be that such filtering is probably best implemented on the client side, i.e. in VSCode or a VSCode plugin rather than in clangd or clang-tidy.

like image 111
HighCommander4 Avatar answered Jun 26 '26 22:06

HighCommander4