Skip to main content

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

Boom! Mind blown (for the support). Woohoo!

Will follow up on bugzilla.


— greg

On Jun 3, 2021, at 7:08 PM, Jonah Graham <jonah@xxxxxxxxxxxxxxxx> wrote:

Hi Greg,

You have come to the right place.

I would be happy to work with you to get this feature in - it will go faster if you are able to contribute some of the improvements too.

To get us started I created a WIP that adds Pragmas to the C model so it will display in the outline. There are probably a bunch of things to think about, and I have done nothing on making the UI nice, but here is what it looks like:


The gerrit containing this change is - we just need to discuss next steps. The bug is probably the best place to do that.


Jonah Graham
Kichwa Coders

On Thu, 3 Jun 2021 at 12:38, Greg Willits <gwillits@xxxxxxxxxx> wrote:

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:

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


cdt-dev mailing list
To unsubscribe from this list, visit
cdt-dev mailing list
To unsubscribe from this list, visit

Back to the top