Bug 328259 - [UI] Add parentheses after "macro" #define labels
Summary: [UI] Add parentheses after "macro" #define labels
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-source-nav (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 8.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2010-10-20 11:27 EDT by Patrick Hofer CLA
Modified: 2010-10-21 07:23 EDT (History)
1 user (show)

See Also:


Attachments
proposed patch (7.26 KB, patch)
2010-10-20 11:28 EDT, Patrick Hofer CLA
mschorn.eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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