vscode-code-outline icon indicating copy to clipboard operation
vscode-code-outline copied to clipboard

Ability to add titles via comments

Open WCByrne opened this issue 7 years ago • 6 comments

Taking from Xcode (not sure if it exists elsewhere) it would be great to be able to parse comments into titles in the outline. The outline is a HUGE help but some long files can still be difficult to browse quickly.

Something like:

MARK: Actions
function doThing {} 
function doOtherThing {} 

MARK: Helpers
function helpThings {} 
function helpMore {} 

Would resolve to:

‣ Actions ▪︎ doThing ▪︎ doOtherThing

‣ Helpers ▪︎ helpThings ▪︎ helpMore

WCByrne avatar Oct 13 '17 04:10 WCByrne

Thank you for the suggestion.

I'm not currently planning to do any custom parsing of all possible syntaxes. VSCode has preliminary support for regions for folding and I'll see if those can be accessed programmatically.

patrys avatar Oct 13 '17 09:10 patrys

Region would be a good tag as well. Anything that could make sense to break up the outline.

WCByrne avatar Oct 16 '17 23:10 WCByrne

I was going to suggest support for Regions! I have been using them to group functions in my Powershell scripts so it would be great to have them show in the outline just like functions including sub functions. Thank you for your great work !

jonathanv81 avatar Oct 19 '17 12:10 jonathanv81

Regions aren't supported in all languages though right?

WCByrne avatar Oct 24 '17 19:10 WCByrne

They aren't but this plugin does not do any language-specific processing and relies on language plugins to provide symbol locations. This means implementing comment marks is roughly the same amount of work as adding region support to your language of choice.

patrys avatar Oct 24 '17 20:10 patrys

Thank you for looking into it. Have a good weekend.

jonathanv81 avatar Oct 27 '17 08:10 jonathanv81