languageserver icon indicating copy to clipboard operation
languageserver copied to clipboard

Enable multiple-level fold section of R document like RStudio

Open Yunuuuu opened this issue 3 years ago • 0 comments

Here is some example code to explain this work:

# section one ----
a <- 1:10

## first sub-section ----
b <- letters

### first sub-sub-section ----
d <- 1:2

## second sub-section ----
e <- LETTERS

### sub-sub-section ----
f <- 1:3

#### sub-sub-sub-section ----
g <- 1:20

# complex nested fold section can work well -----
a <- function(x) {b <- function() {
        # collapse following section will not go beyond this function `b`
        # section for function b ------
        x <- 1:2
        x
    }

    # section one ----
    a <- 1:10

    ## first sub-section ----
    b <- letters

    x <- function() {
        # section for function x -----
        c(a, b, d)
    }
}

image This is what the outline look like: image

Yunuuuu avatar Aug 02 '22 00:08 Yunuuuu