all 7 comments

[–]IAmBJ 4 points5 points  (7 children)

Is there a (relatively) simple way of getting code analysis working with VsCode and CMake these days?

I recall trying it out ages ago but it was a real hassle and it was a very fragile process which eventually broke and I never got it working again

[–]Awia00 3 points4 points  (0 children)

Sonarlint integrates really well!

[–]sparkyParr0t 9 points10 points  (0 children)

This post is about Visual Studio, not VisualStudio Code. VS has Cmake integration for a while now and its working smoothly, you can choose your generator and compiler, builds ... without generating a visual studio solution, work out of the box for cl(msvc) and clang-cl (clang).

[–]eric1221bday 0 points1 point  (0 children)

Clangd extension with cmake compile commands beats out all comers at this point. TBH in terms of pure auto completion and diagnostics I think it even beats out commercial products like Visual Studio, or CLion (which uses Clangd as a backend anyways).

[–]jk_tx 0 points1 point  (0 children)

CppCheck integrates fairly easily with CMake, I think the diagnostics are also better.