A VSCode extension that automatically adds and updates file path comments at the top of your files. This extension helps maintain accurate file path information in your codebase, especially useful in large projects.
Features
🚀 Automatically adds a file path comment when creating new files
🔄 Updates the path comment automatically when files are moved or renamed
📁 Uses workspace-relative paths for better portability
⚡ Works with all file types
🎯 Zero configuration required
💫 Command to update current file path comment
🌟 Command to update all files path comments in workspace
🧹 Clean formatting without extra empty lines
File Creation
When you create a new file, the extension automatically adds a comment with the relative path:
//src/components/Button.tsx
class Button extends Component {
File Movement/Rename
When you move or rename a file, the path comment updates automatically to reflect the new location:
// Before (in src/components/Button.tsx):
//src/components/Button.tsx
// After moving to src/shared/Button.tsx:
//src/shared/Button.tsx
Commands
The extension provides two commands:
Add/Update File Path Comment to Current File - Updates path comment in the currently open file
Add/Update File Path Comments to All Files - Updates path comments in all files in the workspace
Requirements
VSCode 1.60.0 or higher
Workspace must be a folder or workspace (not a single file)
Installation
Open VSCode
Open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X)
Search for "Add Update Pathfile"
Click Install
Extension Settings
This extension has no settings. It works out of the box with zero configuration needed.
Known Issues
The extension only updates comments that start with // at the beginning of the file
Comments are always added in single-line format, regardless of the file type
Release Notes
1.1.0
New features and improvements:
Added new command to update path comment in current file only
Added new command to update path comments in all workspace files
Improved formatting to remove extra empty lines between path comment and code
Fixed issue with duplicate path comments when updating existing files
Improved path comment detection to avoid conflicts with code comments
1.0.0
Initial release:
Add file path comments on file creation
Update path comments when files are moved or renamed