Function Folding (Ctrl+M+O)
OverviewFunction Folding is a Visual Studio Code extension for folding function and method bodies in TypeScript and TypeScript React files. It identifies function-like syntax using the TypeScript compiler API and folds the corresponding regions without targeting surrounding classes, interfaces, or control-flow blocks. Highlights
Folding behaviorThe extension targets multiline, block-bodied function-like declarations and expressions. It does not target function signatures without implementations or single-line function bodies. Classes, interfaces, namespaces, and control-flow statements such as InstallationFrom the Marketplace
From a VSIXFor local installation:
Usage
Alternatively, open the Command Palette with Keyboard shortcut
The shortcut is active when a TypeScript or TypeScript React editor has focus. In other editor contexts, the default Commands
Requirements
PrivacyThe extension reads the active TypeScript or TSX document locally to identify function-like syntax. It does not send source code or file contents to a remote service. SupportReport bugs and request features through the project's GitHub repository: https://github.com/CleanEngineering/FunctionOnlyFolding_VSCode_Extension/issues DevelopmentThe extension uses the VS Code Extension API and the TypeScript compiler API to identify function-like syntax and invoke VS Code's native folding command. To install dependencies, run tests, and package the extension:
LicenseMIT. See LICENSE. PublisherCreated and maintained by CleanEngineering. Repository: https://github.com/CleanEngineering/FunctionOnlyFolding_VSCode_Extension SupportIf this extension is useful to you, consider supporting its development: Your support helps me continue building and maintaining free, open-source tools for developers. |