microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.51k stars 1.55k forks source link

Support #pragma mark or similar technics in Outline View #7675

Open Dajchan opened 3 years ago

Dajchan commented 3 years ago

Type: Feature Request

it would be nice to support markers in code (especially in implementation files) to highlight and seperate entries in the Outline View somehow similar to the feature used by XCode.

sean-mcmanus commented 3 years ago

VS Code doesn't have an appropriate "SymbolKind" type to match a #pragma mark or #pragma region -- can you file a feature request on VS Code to add a SymbolKind? If you can give examples of other languages that could benefit then they're more likely to add that.

Also, this feature seems like it would only give "good" results when the Outline view is sorted by Position.

Dajchan commented 3 years ago

For clarification. VS Code needs to support "SymbolKind" in the Outline View or in the Language Service as a whole?

sean-mcmanus commented 3 years ago

Both. We'd prefer some "Region" or "Marker" type added to vscode.SymbolKind...although I guess we could just use an existing SymbolKind like "Namespace" and add some comment to the symbol name like we do for other missing SymbolKinds like type aliases.

github-actions[bot] commented 3 years ago

This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog.

github-actions[bot] commented 2 years ago

This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog.

github-actions[bot] commented 2 years ago

This feature request has received enough votes to be added to our backlog.

andyjeffries commented 2 years ago

Is this a duplicate of https://github.com/microsoft/vscode/issues/74843 ? The issue there seems to be describing it well (and is outside of C++ support)

sean-mcmanus commented 2 years ago

It potentially is, depends on if/how they fix it.

ioquatix commented 1 year ago

image

Seems like this is working now?

andyjeffries commented 1 year ago

Sorry, my comment above isn't valid - now it's obvious that this bug refers to the Outline view, the other one refers to the Minimap.

AndrewCapon commented 1 year ago

Hi @ioquatix ,

How did you get the pragma marks to work in the outline view?

Thanks

Andy

ioquatix commented 1 year ago

@AndrewCapon I did not do anything special. i.e. there is no configuration option AFAIK. What part is not clear from my screenshots? Maybe try copying the pragma I showed exactly?

AndrewCapon commented 1 year ago

Hi @ioquatix

Thanks for the reply, nothing is not clear in the screenshots, it just doesn't work here :)

My outline is always flat, the grouping is not shown.

ioquatix commented 1 year ago

I just tested it again and it's still working as expected.

image

Maybe it depends on the language, the format of the pragma, etc.

AndrewCapon commented 1 year ago

Thanks @ioquatix

I have tested it with .c, .cpp and .h, same pragma format as you are using.

Very strange, I'm on a Mac. I will test it on windows later today and see if that makes a change.

Thanks for the help

Andy

ioquatix commented 1 year ago

Before I was trying on Linux, and those are the screenshots. You are right, maybe the result is platform dependent, but it also seems to be working on Mac:

code
mrx23dot commented 3 months ago

For me this would be noise, if you implement it then please don't make it default.

Ramirez97 commented 2 months ago

I believe this only works on Mac, I've tried in windows and it doesn't work, only the #pragma region used by the MSVC compiler.