{"id":22423440,"url":"https://github.com/prantlf/vscode-fold-on-open","last_synced_at":"2026-02-27T09:11:20.521Z","repository":{"id":150431736,"uuid":"318300666","full_name":"prantlf/vscode-fold-on-open","owner":"prantlf","description":"Folds comments or other targets in code files automatically when you open them.","archived":false,"fork":false,"pushed_at":"2020-12-14T14:32:45.000Z","size":72,"stargazers_count":5,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-05T18:11:40.691Z","etag":null,"topics":["comments","fold","fold-comments","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prantlf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-03T19:40:00.000Z","updated_at":"2024-07-04T09:50:26.000Z","dependencies_parsed_at":"2023-04-24T17:27:10.003Z","dependency_job_id":null,"html_url":"https://github.com/prantlf/vscode-fold-on-open","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fvscode-fold-on-open","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fvscode-fold-on-open/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fvscode-fold-on-open/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fvscode-fold-on-open/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prantlf","download_url":"https://codeload.github.com/prantlf/vscode-fold-on-open/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236651960,"owners_count":19183544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comments","fold","fold-comments","vscode","vscode-extension"],"created_at":"2024-12-05T18:11:22.604Z","updated_at":"2025-10-15T23:30:42.136Z","avatar_url":"https://github.com/prantlf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fold on Open for Visual Studio Code\n\n[\u003cimg src=https://raw.githubusercontent.com/prantlf/vscode-fold-on-open/master/src/logo.png height=20 alt=Logo\u003e][from the marketplace]\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![Build Status](https://github.com/prantlf/vscode-fold-on-open/workflows/Test/badge.svg)](https://github.com/prantlf/vscode-fold-on-open/actions)\n\nFolds comments or other targets in code files automatically when you open them in [Visual Studio Code].\n\n\u003e Tip: If your code includes long JSDoc comments for generating the project documentation, you can fold them automatically when opening a file, so that you will be able to focus on the code and work more efficiently:\n\n```json\n\"foldOnOpen.targets\": [\"AllBlockComments\"]\n```\n\n## Installation\n\nInstall this extension to your Visual Studio Code [from the marketplace], or download a specific version of a [released package] and install it from the file.\n\n## Configuration\n\nThis extension contributes the following settings. The names have to be prefixed by \"foldOnOpen.\", when entered to `settings.json`:\n\n| Name | Description | Type | Default value | Valid values |\n| ---- | ----------- | ---- | ------------- | ------------ |\n| `targets` | Targets to fold when a file is opened. Leave it empty to disable the automatic folding. | `string[]` | `[]` | `All`, `AllBlockComments`, `AllMarkerRegions`, `Level1`, `Level2`, `Level3`, `Level4`, `Level5`, `Level6`, `Level7`, `Recursively` |\n| `enableFiles` | Enables the automatic folding for the specified file patterns only. All file patterns are enabled enabled by default. | `string[]` | `[\"**/*\"]` | patterns known from `files.exclude`, e.g. |\n| `disableFiles` | Disables the automatic folding for the specified file patterns. No file patterns are disabled by default. | `string[]` | `[]` | patterns known from `files.exclude`, e.g. |\n\nIf a file pattern starts with `/`, it will match file paths from the file system root. If a file pattern starts with `**`, it will match the rest of the file path on any directory. If a file pattern start with neither `/` nor `**`, it will consider file paths starting in the project folder as the root.\n\n### Examples\n\nSettings can be applied either for all files:\n\n```jsonc\n// enable initial block comment folding everywhere except for tests\n\"foldOnOpen.targets\": [\"AllBlockComments\"],\n\"foldOnOpen.disableFiles\": [\"**/test/**/*\"]\n```\n\nor scoped for a particular language:\n\n```jsonc\n// enable initial block comment folding only for JavaScript files and\n// only in `src` directories in the project root\n\"[javascript]\": {\n    \"foldOnOpen.targets\": [\"AllBlockComments\"],\n    \"foldOnOpen.enableFiles\": [\"src/**/*.js\"]\n}\n```\n\nAdditionally, you can decide to save the settings globally to User settings, or locally to Workspace or Project Folder settings. If you want to switch your settings independently on those locations, you can have a look at the [Profile Switcher]. Read also about [settings scopes in VS Code].\n\n## Troubleshooting\n\nIf the JSDoc comments are not folded, you can try disabling the [syntax-aware folding]:\n\n```json\n\"editor.foldingStrategy\": \"indentation\"\n```\n\n## License\n\nCopyright (c) 2020 Ferdinand Prantl\n\nLicensed under the MIT license.\n\nThe logo was based on an [original icon](https://icon-icons.com/icon/fold/106402) published among [Octicons by GitHub](https://icon-icons.com/pack/Octicons/1524) under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license. Thank you!\n\n[Visual Studio Code]: https://code.visualstudio.com/\n[from the marketplace]: https://marketplace.visualstudio.com/items?itemName=prantlf.fold-on-open\n[released package]: https://github.com/prantlf/vscode-fold-on-open/releases\n[syntax-aware folding]: https://code.visualstudio.com/updates/v1_24#_syntax-aware-folding-enabled-by-default-for-jsts\n[Profile Switcher]: https://marketplace.visualstudio.com/items?itemName=aaronpowell.vscode-profile-switcher\u0026WT.mc_id=javascript-11196-aapowell\n[settings scopes in VS Code]: https://code.visualstudio.com/docs/getstarted/settings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Fvscode-fold-on-open","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantlf%2Fvscode-fold-on-open","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Fvscode-fold-on-open/lists"}