Bug 404221 - Contents of C/C++ macros should also be highlighted like other code
Summary: Contents of C/C++ macros should also be highlighted like other code
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-12 02:00 UTC by Shriramana Sharma
Modified: 2019-08-24 16:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
screenshot showing katepart not having this feature (171.33 KB, image/png)
2019-02-12 02:00 UTC, Shriramana Sharma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shriramana Sharma 2019-02-12 02:00:47 UTC
Created attachment 117989 [details]
screenshot showing katepart not having this feature

CURRENT BEHAVIOUR:
In Katepart used in KWrite/Kate/KDevelop, the contents of C/C++ macros are all highlighted with a single colour.

DESIRED BEHAVIOUR:
While the current behaviour is OK for short macros, sometimes we do need to write longer ones. So it would be great if they are also highlighted like other code since anyhow they are going to be part of the code.

Atom Editor has this feature. See the attachment. 

Am using Katepart 5.44.0 on Kubuntu Bionic.
Comment 1 Christoph Feck 2019-03-09 00:02:16 UTC
Using Kate 18.12.3 with KDE Frameworks 5.56.0, I see code in #define macros highlightes the same as other code for *.cpp files.

I remember that previous behavior was like you described, but I couldn't find the commit that changed it.
Comment 2 Nibaldo G. 2019-04-02 04:56:11 UTC
The C++ highlighter (ISO C++) highlight code inside the #define macro. Here it works well.

But the C highlighter doesn't highlight code inside macros, here the behavior is like the one you describe (everything is green).

The code highlighting in macros for C++ was added in: https://phabricator.kde.org/D13394
This was included in KDE Frameworks 5.49.0 (August 2018)
Comment 3 Dominik Haumann 2019-05-19 16:06:45 UTC
@Shriramana Sharma: Since this works for C++, is that good enough? If we, I think we can close this report. Otherwise, we need someone to step up with a patch.
Comment 4 Christoph Cullmann 2019-08-24 16:10:48 UTC
I think we can live with it being improved in ISO C++, until somebody steps up to work on this.