News for hackers. Stuff that matters.
Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by rs186 on Thursday April 24, 2025 @06:45PM (#43788332)
The intellisense from clangd is much better and faster than the Microsoft C++ extension, if you can set up a compile_commands.json. Although debugging still relies on the Microsoft extension. Although I don't think it's going to be hard to create an extension just for debugging (if it does not already exist?)
Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by geertj on Thursday April 24, 2025 @07:02PM (#43788477)
Yes, even on medium sized code bases (few 100K lines), the Microsoft C++ extension gets extremely slow. Clangd is a much better option.
Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by Rucadi on Thursday April 24, 2025 @06:55PM (#43788418)
Lldb and rr (midas) have vscode extensions
Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by senderista on Thursday April 24, 2025 @10:03PM (#43789490)
Not just faster, I have never been able to get jump to declaration/definition/references to work reliably without clangd.
Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by nomad41 on Friday April 25, 2025 @02:57AM (#43790923)
I've had the opposite experience with weird C++ projects from some customers that use external toolchains. For some reason even creating the compile_commands.json file with Bear doesn't work, while the proprietary Intellisense extension works out of the box without any configuration.
Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by IshKebab on Friday April 25, 2025 @09:55AM (#43793593)
I agree. It's way better. You can use the CodeLLDB extension for debugging.

https://github.com/vadimcn/codelldb

Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by Melonai on Friday April 25, 2025 @10:57AM (#43794249)
There are other third-party extensions which rely on the Microsoft C++ one. I have recently ran into this problem with my VSCodium setup.
Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by starkrights on Friday April 25, 2025 @11:42AM (#43794804)
Is there a ‘right’ (or simple/direct) way to generate this using various buildchains? I remember setting this up so I could use Sublime with intellisense a while ago, and finding that I could only get it to generate with a specific compiler chain on windows (ninja I think?)

Minor annoyance to have to make my c make project generate buildchain files for a compiler I’m not using & copy that file into my project root to commit it- unrelated to the original question, but also annoying that I have to manually generate it every time I make significant codebase changes.

Re:Devs sound alarm after Microsoft subtracts C/C++ extensio... by TuxSH on Sunday April 27, 2025 @01:06PM (#43813392)
> and finding that I could only get it to generate with a specific compiler chain on windows (ninja I think?)

Yes, you're right about that.

Basically, it boils down to "use CMake with Ninja/Makefile" (even if you don't strictly have to, you could write a script that creates the json yourself, for example). When cross-compiling, you may also have to whitelist compiler paths.

Add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON as command-line arg during the config step, or add the equivalent "set" call to your CMakeLists.txt, restart clangd (ctrl+p, restart clangd), and you're good to go.

There are minor annoyances when cross-compiling (it using clang -- some compile options are incompatible and need to be removed in global user config, and it not extracting default compiler defines from compilers) but they are very easily worked around

I more or less use this as config: https://gist.github.com/TuxSH/0220d1235dace77f82738c96718011...