[folding] Format large file unfold all code

Open
#319,286 0 comments 0 reactions 1 assignee View on GitHub

@aeschli is already working on this.

Since Jun 1, 2026.

Assessment

This issue has not been assessed yet.

Description

Version: 1.122.1 (user setup)
Commit: 8761a5560cfd65fdd19ce7e2bd18dab5c0a4d84e
Date: 2026-05-29T09:25:37+02:00
Electron: 39.8.8
ElectronBuildId: 13870025
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Steps to Reproduce:

  1. run below py to create example files
with open("example.js", "w") as f:
  f.write("const bigClass      = (function () {\n")
  for i in range(30):
    f.write(f"  function function{i}() {{\n")
    for j in range(100):
      f.write(f"    console.log('function{i} - line{j}');\n")
    f.write("  }\n")
  f.write("}());\n")
with open("example.py", "w") as f:
  f.write("def bigFunction       ():\n")
  for i in range(30):
    f.write(f"  def function{i}():\n")
    for j in range(100):
      f.write(f"    print('function{i} - line{j}')\n")
    f.write("\n")
  f.write("\n")
  1. run command "Fold level 2"
  2. format
  3. all code unfolded

python file:

  • cursor will move to end of the line
  • cant reproduce without run the script again (caching?)

js file:

  • cursor will move to end of the file
  • can reproduce by adding some extra spaces then format
Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

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.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.