Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328259

Summary: [UI] Add parentheses after "macro" #define labels
Product: [Tools] CDT Reporter: Patrick Hofer <paedu.hofer>
Component: cdt-source-navAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: enhancement    
Priority: P3 CC: cdtdoug
Version: 8.0Keywords: contributed
Target Milestone: 8.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch mschorn.eclipse: iplog+

Description Patrick Hofer CLA 2010-10-20 11:27:11 EDT
Make the labels of "macro" visually different by adding parentheses after the name.

This was requested before in Bug 26482

#define DOUBLE(a)  (2*a)  
This should show up in the UI as DOUBLE().

I think we should not show the parameter names as we don't show them in function labels. Just the type is shown there and we have no type here.

Refer to Bug 26482 comment 3:
"2) ... 
, but I still miss the second 
part of bullet 2, making a difference between "macros" and "pure defines".
What I mean is something like:
#define RANDOM_NUMBER  4711
#define DOUBLE(a)  (2*a)
has a quite distinct "semantic" meaning in the source code, and that this 
should be represented in the outline. At a minimum, DOUBLE should be shown 
as "DOUBLE(a)" and not just "DOUBLE". Even nicer would be if the icons were 
somehow different."
Comment 1 Patrick Hofer CLA 2010-10-20 11:28:41 EDT
Created attachment 181304 [details]
proposed patch

There might be better ways to implement this. Feedback is very welcome.
Comment 2 Markus Schorn CLA 2010-10-21 06:37:08 EDT
Thanks, I have committed your patch.
Implemented in 8.0 > 20101021