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:
Open any JavaScript or TypeScript file (.js
/ .ts
)
Place your cursor on the line of a function declaration
Trigger the extension:
❗ Rebinding Shortcut Key
If Ctrl+H
doesn’t work (might be in use by another command):
🔧 To change it manually:
- Open Command Palette →
Preferences: Open Keyboard Shortcuts
- Search for
Generate Function Header
- Click the ✏️ icon and press your desired keybinding (e.g.,
Ctrl+H
, Alt+Shift+H
, etc.)
You can configure the Created By
and Modified By
fields via VS Code settings.
✨ Option 1: UI Settings
Open Command Palette (Ctrl+Shift+P
)
Search:
Preferences: Open Settings (UI)
In the search bar, type:
Function Header Generator
Set:
- ✅ Created By – Your name (e.g., Ajay Chilamsetti)
- ✅ Modified By – Default modifier name (optional)
✨ Option 2: Edit settings.json
Directly
- Open Command Palette →
Preferences: Open Settings (JSON)
- 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.