Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Outline View Group Labels Feature Request

Hello,

First, a thank you to everyone for the efforts put into Eclipse and CDT.

I’m told this might be the place to lobby for a small feature in the CDT editor.

I would like to see the Outline view enhanced to better reveal a file’s organization. I suspect most of us in a given header file logically group declarations which are related to each other. A file with 15 function might have 4 related to “this” and 6 related to “that,” and they would be in some sequence reflecting that, maybe even with a comment line above each group to identify that they are related like “// Input Parsing” or something.

In Xcode, the comment “Input Parsing” makes it’s way into the Outline view so that the file organization is much easier to read and navigate.

I’ve attached an image to illustrate this, and I’ve previously submitted a report here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=546981

Xcode uses “#pragma mark” syntax in the header file to allow the author to inject dividers and labels into the Outline list.

// this adds a single divider line before adding MyLabel as a group label (one hyphen)
#pragma mark - MyLabel

// this adds a divider line before and after adding MyLabel as a group label (two hyphens)
#pragma mark - MyLabel -

These can be added anywhere in the header file allowing the author to label like-purposed code.

If a person doesn’t care for this, they don’t have to use it. They don’t add the syntax to their files, and nothing changes for them. 

For those who want to use it, it requires very simple markup with significant flexibility.

Ultimately this could be done for any language in Eclipse with special comment markers, but for now, I would like to see it available for C/C++.

I’ve yammered on long enough. Thanks for listening.

— greg willits






Back to the top