CodeErrorGuard+Manage the complete lifecycle of generated try/catch structures in Visual Studio Code. CodeErrorGuard+ helps developers insert, review, navigate, and remove language-specific try/catch structures while keeping ownership of application code exactly where it belongs: with the developer. Instead of focusing only on code generation, CodeErrorGuard+ focuses on the entire workflow around error-handling scaffolding. Whether you are adding temporary protection during a refactor, introducing error handling in legacy code, reviewing generated structures, or cleaning up an entire file before a commit, the extension provides a deterministic and reversible workflow.
Discover generated structures, navigate directly to them, and clean them up safely when they are no longer needed. Why CodeErrorGuard+?Adding a try/catch block is easy. Managing hundreds of them over time is not. Many tools can generate snippets, but they typically stop there. CodeErrorGuard+ provides a complete workflow:
All while preserving the original code contained inside the generated structure. Core PrincipleCodeErrorGuard+ follows a simple rule:
The extension is responsible for the scaffolding it generates. Your application logic remains yours. This principle influences every feature:
The extension does not attempt to rewrite, reinterpret, or refactor user code. Insert Try/CatchThe most common workflow is inserting a try/catch structure at the current cursor location. Place the cursor on a line and run:
Before
After
CodeErrorGuard+ automatically respects the indentation level of the current line, making insertion predictable even inside deeply nested code. Nested Example
becomes:
Wrap Existing LinesExisting code can be wrapped without manually moving or reformatting content. Select one or more complete lines and run:
Before
After
Selections intentionally operate on complete lines. This avoids malformed structures and ensures that transformations remain deterministic. Review Generated StructuresGenerated structures can be discovered and reviewed directly from the explorer view. This allows you to:
This capability becomes especially useful during large refactors or migration work. Remove Generated Try/CatchGenerated structures can be removed as easily as they are created. Place the cursor anywhere inside a generated structure and run:
Before
After
The generated scaffolding is removed and the wrapped code is restored. Remove Generated Structures from an Entire FileLarge refactors often leave many temporary structures behind. Removing them individually can become tedious. Run:
CodeErrorGuard+ will:
This workflow is ideal for:
Generated Structures OnlyCodeErrorGuard+ removes only structures it can positively identify as generated by the extension. Manually written try/catch blocks remain untouched. This provides an important safety guarantee: Generated scaffolding can be cleaned up without risking modifications to user-authored error-handling logic. Multi-Cursor SupportAll major workflows support standard Visual Studio Code multi-cursor editing. Use multiple cursors to: Insert Multiple Structures
across multiple locations simultaneously. Remove Multiple Structures
from multiple generated structures in a single operation. This is particularly useful when working with large files or repetitive patterns. Supported LanguagesCodeErrorGuard+ supports the most common languages used in modern software development:
Each language uses a structure that feels natural for that ecosystem. JavaScript / TypeScript
Python
Go
Custom TemplatesTeams often have their own conventions for exception handling. Some prefer logging. Others prefer rethrowing exceptions. Some use centralized error-reporting systems. CodeErrorGuard+ allows generated structures to be customized through Visual Studio Code settings. Example:
This makes it easy to align generated structures with project standards without changing your workflow. Workspace SupportProjects within the same workspace often require different conventions. CodeErrorGuard+ supports workspace-aware configuration through:
This allows teams working with multi-root workspaces to choose the configuration that should be applied to generated structures. Available CommandsInsert
Review
Remove
Configuration
ContributingCodeErrorGuard+ is open-source and welcomes community contributions:
Before contributing, please review the Contribution Guidelines for coding standards, testing, and commit message conventions. Open an Issue if you find a bug or want to request a new feature. Code of ConductWe are committed to providing a friendly, safe, and welcoming environment for all, regardless of gender, sexual orientation, disability, ethnicity, religion, or other personal characteristic. Please review our Code of Conduct before participating in our community. ChangelogFor a complete list of changes, see the CHANGELOG.md. Authors
See also the list of contributors who participated in this project. Follow MeOther Extensions
Recommended Browser ExtensionFor developers who work with
LicenseThis project is licensed under the MIT License. See the LICENSE file for details. |
