Replies: 2 comments
-
This issue is being marked as stale because there was no activity in the last 2 months |
Beta Was this translation helpful? Give feedback.
0 replies
-
Still relevant |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have checked that this feature is not already implemented
Use case
Code organization within the file doesn't always follow blocks semantics: sometimes it's nice to group a few methods together inside a class, or name a few top-level methods, etc.
Description
VS Code supports folding regions based on comments, but Ruby doesn't seem to use any of the comment styles on that page, and the supported folding feature doesn't mention an alternative comment style.
Implementation
RubyLsp::Listeners::FoldingRanges
should be extended to notice region comments.I'd suggest we follow the other languages and use the format
# region Name
.#region
and# region
should both work)# region
and# region Section
should both work)#
up front (so# region
and######### region
should both work)If there's some format that could match RDoc or YARD style (
# @region
?), that'd be a good alternative, too.Beta Was this translation helpful? Give feedback.
All reactions