Created attachment 156076 [details] Code with #if directive SUMMARY Code inside #if directive gets highlighted as commented when LSP Client's Semantic Highlighting Option is enabled The LSP Server is clangd On removing the #if directives and reopening the file from within Kate, Code Highlighting works normally STEPS TO REPRODUCE 1. Enable the Semantic Highlighting option from LSP Client Settings 2. Write some C/C++ code inside #if directives
Created attachment 156077 [details] Code without #if directive
This is a feature, not a bug :) When the macro directive is not defined/disabled etc. The code has no effect, and thus is treated as disabled / commented. This helps in easily telling if the macro has any affect or not. Of course it can be a bit annoying at times e.g with header only stb style libraries. But Kate can't do anything about this as it is not Kate that decides this, but clangd. So if you want to argue about the behavior best take it up with clangd devs