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

Function Header Generator

Ajay Chilamsetti

|
9 installs
| (0) | Free
Automatically inserts a clean and well-formatted comment header above your function including its name, objective, parameters, return type, and author info.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

📌 Function Header Generator

Function Header Generator is a lightweight and intuitive VS Code extension that automatically inserts clean, well-formatted header comments above your functions. It extracts the function name, parameters, and return values, while also injecting dynamic metadata such as the author name and date — making your code more readable and easier to maintain.


🚀 Features

  • ✅ Auto-generates function header comments
  • 🧠 Detects function name, parameters, and return value
  • 📅 Adds current date dynamically
  • 👤 Includes customizable Created By and Modified By fields
  • 📝 Auto-generates objective based on function name
  • 🔧 Works with JavaScript & TypeScript files
  • ⚡️ Easily triggerable via shortcut or command palette
  • 🧼 Clean, minimal, and professional format

💡 How to Use

✨ You can trigger the extension using a shortcut or the command palette.

📍 Steps:

  1. Open any JavaScript or TypeScript file (.js / .ts)

  2. Place your cursor on the line of a function declaration

  3. Trigger the extension:

    • ⌨️ Shortcut: Ctrl+H (default keybinding)

    • 🗽 Or open Command Palette (Ctrl+Shift+P) and search:

      Generate Function Header
      

❗ Rebinding Shortcut Key

If Ctrl+H doesn’t work (might be in use by another command):

🔧 To change it manually:

  1. Open Command Palette → Preferences: Open Keyboard Shortcuts
  2. Search for Generate Function Header
  3. Click the ✏️ icon and press your desired keybinding (e.g., Ctrl+H, Alt+Shift+H, etc.)

⚙️ Customize Author Information

You can configure the Created By and Modified By fields via VS Code settings.

✨ Option 1: UI Settings

  1. Open Command Palette (Ctrl+Shift+P)

  2. Search:

    Preferences: Open Settings (UI)
    
  3. In the search bar, type:

    Function Header Generator
    
  4. Set:

    • ✅ Created By – Your name (e.g., Ajay Chilamsetti)
    • ✅ Modified By – Default modifier name (optional)

✨ Option 2: Edit settings.json Directly

  1. Open Command Palette → Preferences: Open Settings (JSON)
  2. Add the following:
{
  "functionHeader.createdBy": "Ajay Chilamsetti",
  "functionHeader.modifiedBy": "Ajay Chilamsetti"
}

🖼️ Example Output

/************************************************************************/
/* Function Name: handleUpload
   Objective: Handle upload
   In Params:  file: File, userId: string
   Out Params: result
   Created By: Ajay Chilamsetti [Date: 17/July/2025]
   Modified By: Ajay Chilamsetti [Date: 17/July/2025]
/************************************************************************/
function handleUpload(file: File, userId: string) {
  // function implementation
}

📣 Happy documenting! Let your functions speak clearly! ⭐️ Don’t forget to star the extension if you find it useful.

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