Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support comment-derived sections in the R code outline #4393

Closed
gadenbuie opened this issue Aug 19, 2024 · 2 comments
Closed

Support comment-derived sections in the R code outline #4393

gadenbuie opened this issue Aug 19, 2024 · 2 comments

Comments

@gadenbuie
Copy link

RStudio support comment sections, e.g.

# Setup -----------------------------------------------------------------------

# UI ----

#### Server ####

I think the specific rules are:

  1. A comment ending in 4+ dashes (----)
  2. A comment surrounded by 4+ hashes on both sides #### Title ####

In RStudio, these structural comments are then exposed in the document outline and are foldable.

RStudio doesn't differentiate between these headings as having any kind of hierarchy, but it'd be a helpful and welcome addition if they could. I'd personally advocate for the above examples being level-1, level-3 and level-2 headings (respectively), but I'd be open to any kind of rule. Another option would be to assume similar heading styles are at the same level and any change in heading style indicates a sub-section.

This issue was also mentioned in #1427:

The VSCode outline does not support sections, sub sections etc in a way that makes it easy to navigate a long script like the Rstudio IDE does. Would really love having those sections/subsections including indentations like it's in the Rstudio

Originally posted by @IyarLin in #1427 (comment)

@juliasilge
Copy link
Contributor

I believe this is the same as #3822. Feel free to add additional detail there!

@gadenbuie
Copy link
Author

Will do thanks!

@gadenbuie gadenbuie closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants