microsoft / microsoft/TypeScript
JavaScript/TypeScript region folding with //region does not work
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
- VSCode Version: 1.30.2
- OS Version: Linux x64 4.20.0-arch1-1-ARCH
Steps to Reproduce:
- Use
//regionand//endregionin JavaScript and/or TypeScript files to create folding regions.
Does this issue occur when all extensions are disabled?: Yes
The release notes for 1.17 mention that support was added for folding regions. For JavaScript/TypeScript, both //#region //#endregion and //region //endregion were added. However only //#region //#endregion seem to work. //region //endregion do not work.
This is annoying because some projects I work on use this syntax throughout all the code.

Code snippet
//region region
//endregion
// region region with space
// endregion
//#region #region
//#endregion
// #region #region with space
// #endregion
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named in the issue. Start by reproducing the JavaScript and TypeScript snippets in VS Code with extensions disabled, then trace the folding-region handling for the supported comment forms. Done means both //region and //endregion forms fold as described, alongside the existing //#region behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100