Bug 252244 - Improper coloration of C++ keywords in preprocessor directives
Summary: Improper coloration of C++ keywords in preprocessor directives
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 6.0   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-27 14:20 EDT by Andrew Gvozdev CLA
Modified: 2020-09-04 15:27 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Gvozdev CLA 2008-10-27 14:20:51 EDT
Well, bug 246369 fixes more serious "Expression syntax error" for preprocessor statements, but C/C++ keywords should not be colored as such in preprocessor directives. Consider:

#warning Try using header <static.h> or <struct.h> if you need bool types

The coloration in this admittedly artificial example is unsettling. It seems that all preprocessing directives such as #if, #ifdef, #pragma, #include do that.

Additionally, #warning itself does not behave inside other preprocessor statements:

#error #include/#define/#warning/#error should not be highlighted inside #warning/#error either

An observation: I notice that in #error the message is highlighted with squiggly line not including "#error" but in #warning the whole line including "#warning", fwiw.