Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Header Guard GeneratorNew to Visual Studio Code? Get it now.
Header Guard Generator

Header Guard Generator

Phytolizer

|
3,946 installs
| (1) | Free
Generate C/C++ header guards
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Header Guard Generator

A simple generator for C-style header guards.

Usage

The extension provides two commands ("Generate Header Guard" and "Update Header Guard").

  • "Generate Header Guard" will generate a snippet containing by default the name of your header guard, and insert it at your cursor's position.
  • "Update Header Guard" will find an existing header guard (with comment following the #endif), and change the identifier to match the file's location.

Extension Settings

This extension contributes the following settings:

  • header-guard-generator.stopDirs: A list of directories that will be treated as the "root". The last matching directory found will be used. Use this to prevent leaking, for example, the name of your home directory.
  • header-guard-generator.enableTrailingUnderscore: If true, an "_" character is added at the end of the generated identifier.

Known Issues

The update command requires a matching comment after the #endif currently.

Release Notes

1.0.0

Initial release of Header Guard Generator.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft