SUMMARY KDevelop does not do this, and I can't find anything about it, but I can't imagine why anybody would want to disable syntax highlighting within an include guard. It's been a while since I've been using KDE, but I don't remember Kate ever doing this before. I apologize if this is the desired behavior, but I can't find any documentation on it and it is undesirable behavior. I want to edit the contents of #ifdef blocks regardless of whether or not Kate thinks they will be executed. STEPS TO REPRODUCE Type #ifdef __KATE__ struct test{ int m}; #endif into a file highlighted as C++ source. OBSERVED RESULT Everything in the #ifdef block is now grayed out / displayed as a comment and thus all-but unreadable. Kate does parse the file to determine whether or not she thinks the block will be evaluated, then grays out all text within the block if she thinks it will not. EXPECTED RESULT Syntax highlighting should be enabled in comments. I don't want or expect editors to treat or display the inside of an if() block differently based on their prediction of its behavior, so I'm under the impression this is a bug and not a desired function of the software. SOFTWARE/OS VERSIONS Windows: macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: ( Manjaro Linux ) KDE Plasma Version: 6.5.4 KDE Frameworks Version: 6.21.0 Qt Version: 6.10.1 ADDITIONAL INFORMATION
Sounds like you have the LSP plugin enabled and LSP can't find a definition of __KATE__ and thus marks the block as disabled. Disabling the LSP plugin or setting up the project to work with clangd should "fix" it. https://clangd.llvm.org/installation#project-setup Please re-open if disabling the LSP plugin does not help.
You can also disable "Semantic highlighting" in LSP settings. In the future, it'd be better if we support customizing semantic highlighting colors.