TI E2E Community
Code Composer Studio
Code Composer Forum
Type coloring in CCSv5 editor
Has anyone else noticed that "bool" is colored in .h files and not colored in .c files? Is there any plan in the works to fix that?
While we're at it, can the editor options be extended so user-defined types can be colored? Not necessarily the same color as built-in types, but not the same as ordinary text, either.
I'm moving this to the CCS forum so they can see your feature suggestion.
Please click the Verify Answer button on this post if it answers your question.
The use of bool in a C file is considered a macro reference by the highlighter. Coloring of macro references is not enabled by default but you can turn it on. If you go to Window -> Preferences. Type coloring in the top left filter box. Syntax Coloring under Editor should now be selected and you will see the options on the right.
If my reply answers your question please mark the thread as answered
Now that I've done as you said, it looks as it should.
That still doesn't explain why bool is bold and maroon in the header file and black and plain in the code file the defaults are active.
Curiouser and curiouser!
I turned on coloring for macro references to get bool to look as it should, and it worked as described. However, I didn't like all the other macros showing up in color, so I switched back to black. When I looked at my code again, behold! Not only was the coloring in the .c file gone, as I expected, but the coloring in the .h file had disappeared also.
Is a puzzlement!
In playing with the header file it seems to treat bool as a built-in type there. I just created a blank one and put bool in it and it shows it in bold purple. I changed built in types to not be bold and it changed it. Not sure why it is a built-in type for headers.
I can't replicate what you are seeing though with it disappearing from the headers. Did you change it back to black or uncheck the box to enable highlighting for that class of element? For me I uncheck the box and the coloring goes away for the C file but stays for the H file.
You're right. I hadn't unchecked it. Now it works as it did originally.
Just for fun I went back and looked at a couple of old projects in CCS v4. In v4 bool, true, and false are always red, either in code or headers. In v5 they are always red in headers, always black in code.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.