microsoft / microsoft/TypeScript

JavaScript/TypeScript region folding with //region does not work

Open
#29,379 8 comments 19 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Domain: LS: Outlining Suggestion
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:

  1. Use //region and //endregion in 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.

vscode_folding_regions

Code snippet

//region region
//endregion

// region region with space
// endregion

//#region #region
//#endregion

// #region #region with space
// #endregion

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.