languageserver
languageserver copied to clipboard
Enable multiple-level fold section of R document like RStudio
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)
}
}
This is what the outline look like:
