Fold Forge
Folded line counts, symbol-aware fold commands, and custom fold markers for VS Code.
What It Does
- Displays inline
··· N lines badges after each folded region's first line using a themable color (foldForge.badgeForeground), working with any built-in or language-server folding provider.
- Provides commands to fold all functions, classes, methods, and block comments and to unfold all functions, with an option to leave the cursor's enclosing symbol unfolded. Symbol folds start at the symbol's own folding range, so decorated and brace-on-next-line (Allman) code folds the right block.
- Supports Pro custom start/end regex fold markers per language, opt-in auto-fold on open rules, per-kind symbol depth limits, and Fold To Cursor Context.
Features (Free vs Pro)
| Feature |
Free |
Pro |
Inline folded line count badges (··· N lines) |
Included |
Included |
| Fold All Functions / Classes / Methods |
Included |
Included |
| Unfold All Functions & Fold Comment Blocks |
Included |
Included |
| Keep cursor's own symbol unfolded option |
Included |
Included |
| Custom start/end regex fold markers per language |
Upgrade prompt |
Included |
| Auto-fold on open rules (glob + symbol kinds) |
Upgrade prompt |
Included |
| Fold To Cursor Context |
Upgrade prompt |
Included |
| Per-kind symbol nesting depth limits |
Upgrade prompt |
Included |
Commands
foldForge.foldAllFunctions (Fold Forge: Fold All Functions): Folds all functions in the active editor.
foldForge.foldAllClasses (Fold Forge: Fold All Classes): Folds all classes in the active editor.
foldForge.foldAllMethods (Fold Forge: Fold All Methods): Folds all methods in the active editor.
foldForge.unfoldAllFunctions (Fold Forge: Unfold All Functions): Unfolds all functions in the active editor.
foldForge.foldCommentBlocks (Fold Forge: Fold Comment Blocks): Folds all block comments in the active editor.
foldForge.foldToCursorContext (Fold Forge: Fold To Cursor Context (Pro)): Folds everything except the cursor's enclosing symbol chain (Pro).
fold-forge.enterLicense (Fold Forge: Enter License Key): Prompts for a license key and activates it in VS Code SecretStorage.
Settings
foldForge.showBadges (boolean, default true): Show inline folded line count badges after folded regions.
foldForge.keepCursorSymbolUnfolded (boolean, default false): Leave the symbol containing the cursor unfolded when folding functions, classes, or methods.
foldForge.symbolDepthLimits (object, default { "function": 0, "class": 0, "method": 0 }): Per-kind nesting depth limits (0 = unlimited, 1 = top-level only) (Pro).
foldForge.markers (array, default []): Custom { languages, start, end, kind } single-line regex marker rules. languages must list explicit language ids (Pro; restricted in untrusted workspaces).
foldForge.autoFoldOnOpen (array, default []): Opt-in { glob, kinds } rules to auto-fold matching files when opened (Pro; restricted in untrusted workspaces).
fold-forge.apiBaseUrl (string, default ""): Override the licensing API base URL (must use https://, machine-scoped).
fold-forge.webBaseUrl (string, default ""): Override the web storefront base URL (must use https://, machine-scoped).
Custom Markers
- Every rule must list explicit language ids, for example
"languages": ["typescript"]. The "*" wildcard is not supported: it is ignored with a warning, and a rule left with no languages is skipped.
- A file that has no matching marker keeps the editor's normal folding. When a file does contain markers, Fold Forge returns its marker ranges together with indentation ranges (the same rules as the built-in indentation folding, with off-side handling for Python and YAML), so ordinary folding keeps working. In languages that already have their own folding provider, these indentation ranges are added on top of that provider's ranges. The region markers that a language defines for built-in folding are not part of those indentation ranges, so add them as marker rules if you rely on them in a file where Fold Forge answers.
- Matching is line by line. Patterns with nested quantifiers or repeated alternation, such as
(a+)+ or (a|aa)+, are rejected with a warning because they can hang the regex engine. Lines longer than 2000 characters are skipped to limit the work per line, and a 200 ms budget per document is checked between lines. The budget cannot interrupt a regex that is already running, so keep patterns simple. Folding requests that the editor cancels stop early.
Badge Limits
Badges are inferred from the gaps between the editor's visible ranges, so two cases show no badge: a fold whose header is the last visible line of the viewport, and a fold that runs to the end of the file. Editors shown in diff views are skipped.
Privacy and Data Handling
| Data |
Where |
Retention |
| Editor visible ranges, symbols, and marker matches |
Local memory only |
Current session |
| License key, product ID, machine ID hash |
Sent to licensing API (fold-forge.apiBaseUrl) on Pro activation/refresh |
Active license lifetime |
| Telemetry |
None (collectsTelemetry: false) |
0 days |
Fold Forge collects zero telemetry and never transmits source code or file paths.
Offline Behaviour
- Line count badges, symbol folding, custom markers, and auto-fold rules all work completely offline without editing documents.
- Paid licenses are verified locally using the bundled Ed25519 public key with a 14-day offline grace window.
- In untrusted workspaces,
foldForge.markers and foldForge.autoFoldOnOpen workspace overrides are disabled via restrictedConfigurations.
Pricing
View plans and manage licenses at https://zavygvuq46.execute-api.ap-south-1.amazonaws.com/extensions/fold-forge or https://zavygvuq46.execute-api.ap-south-1.amazonaws.com/pricing.
Support
Report issues or request help at github.com/toolsmith-labs/support.
| |