Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>vscode-add-update-pathfileNew to Visual Studio Code? Get it now.
vscode-add-update-pathfile

vscode-add-update-pathfile

hakanon

|
18 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Add Update Pathfile

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:

  1. Add/Update File Path Comment to Current File - Updates path comment in the currently open file
  2. 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

  1. Open VSCode
  2. Open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X)
  3. Search for "Add Update Pathfile"
  4. 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
  • Support for all file types
  • Relative path support
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft