This is not something me from a year ago would’ve thought I’d be doing, let alone me from fifteen years ago (the last time I did any kernel work), but I’m using a Microsoft programme to work with the Linux kernel.

I’ve got a slew of VSCode extensions installed, most of them not specifically relevant to kernel work.

What are relevant are the extension:

ms-vscode.cpptools (install in the usual way)

and this readymade set of .vscode config files along with a related script:

https://github.com/amezin/vscode-linux-kernel (follow its instructions)

As Marc.2377 says here:

All defines are already in include/generated/autoconf.h (under /usr/src/linux-headers-$(uname -r)/), should be enough to forceInclude it in c_cpp_properties.json