I try to get VS-Code working for my C++ project, but I have the problem that the syntax highlighting ignores preprocessor directives like #if/#else/#endif.
I have the extensions ms-vscode.cpptools (C/C++) and ext install code-gnu-global (Intellisense) installed.
"Go To Definition" shows the #define correctly.

#define ON_TARGET false results to the same highlighting
It should look like this:

VS Code can do it with Microsoft's C/C++ extension since v 0.15 from February 2018.

Visual Studio Code can't do such things out of the box as it is "just" an editor.
If you compile your code, it will work as expected.
For evaluating such defines you need an IDE, e.g. Visual Studio, CLion or you may achieve this with additional Plugins. (e.g. C/C++ Plugin)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With