DevTools is a VS Code extension that provides convenient utilities for developers, including advanced path copying commands, code comment tagging functionality, and file structure copying.
Features
Path Copying Commands
- Copy Absolute Path: Copy the full absolute path of a file or folder
- Copy Relative Path (without Workspace): Copy the relative path without the workspace folder name
- Copy Relative Path (with Workspace): Copy the relative path including the workspace folder name
- Copy File Name (with extension): Copy just the filename with its extension (e.g., "script.js")
- Copy File Name (without extension): Copy just the filename without extension (e.g., "script")
- Copy File with Folder Structure: Copy a file to a specified destination folder while preserving its original folder structure
- Automatically wrap selected code with customizable comment markers
- Supports dynamic comment detection for different programming languages by leveraging VS Code's built-in comment functionality to extract the appropriate comment tokens
- Configurable start and end placeholder text for marking modified code blocks
- Supports %DATE% placeholder that gets replaced with current date in YYYY/MM/DD format
- When placeholders are empty (default), only comments the selected code without additional markers
- When placeholders are configured, wraps code with opening and closing marker lines
All commands are available through:
- File Explorer context menu (right-click on files/folders)
- Editor title context menu (right-click on editor tabs)
- Command palette (Ctrl+Shift+P)
Copy File with Folder Structure
The "Copy File with Folder Structure" command allows you to copy files while preserving their folder hierarchy.
If working space with speific destinationFolder is exist, copy the file to there.
Extension Settings
You can access these settings by going to File > Preferences > Settings and searching for "devtools".
This extension contributes the following settings:
Path Copying Settings
devtools.enableAbsolutePath
: Enable/disable the Copy Absolute Path command (default: true)
devtools.enableRelativePath
: Enable/disable the Copy Relative Path without Workspace command (default: true)
devtools.enableRelativePathWithWorkspace
: Enable/disable the Copy Relative Path with Workspace command (default: true)
devtools.enableCopyFileName
: Enable/disable the Copy File Name (with extension) command (default: true)
devtools.enableCopyFileNameWithoutExt
: Enable/disable the Copy File Name (without extension) command (default: true)
devtools.enableCopyFileWithStructure
: Enable/disable the Copy File with Folder Structure command (default: true)
devtools.destinationFolder
: The destination folder for copying files with structure (default: "./copied_files")
devtools.CommentPlaceholderStart
: The placeholder text before modified code blocks (default: "" - empty string). Use %DATE% for current date in YYYY/MM/DD format.
devtools.CommentPlaceholderEnd
: The placeholder text after modified code blocks (default: "" - empty string). Use %DATE% for current date in YYYY/MM/DD format.
- When empty: Only adds comment prefix to selected lines at first character.
- When configured: Adds opening/closing marker lines around commented code
File Copying Settings
The destinationFolder
setting supports:
- Relative paths (e.g., "aaa\bbb\ccc")
Requirements
No additional requirements or dependencies are needed. The extension works with VS Code's built-in functionality.
Usage Examples
Path Copying
- Right-click on any file in the Explorer panel
- Select one of the DevTools copy commands from the context menu
- The path will be copied to your clipboard and a notification will appear
- Select the code lines you want to tag
- Use the Command Palette (Ctrl+Shift+P) and search for "DevTools: Toggle Comment Tag"
- The selected code will be commented out:
- Default behavior (empty placeholders): Simply adds comment prefix to each line at first character.
- With placeholders configured: Wraps code with marker lines using your configured start/end placeholders
- %DATE% support: Any %DATE% in placeholders gets replaced with current date (YYYY/MM/DD format)
Copy File with Folder Structure
- Right-click on any file in the File Explorer
- Select "Copy File with Folder Structure" from the context menu
- The file will be copied to your configured destination folder with its complete folder path preserved
Known Issues
Currently no known issues. If you encounter any problems, please report them on the extension's repository.
Release Notes
0.0.3
New Features:
- Added "Copy File with Folder Structure" command that copies files to a configurable destination while preserving their original folder structure
- Added
destinationFolder
setting to specify where files should be copied
- Enhanced multi-workspace support for smarter destination folder detection
0.0.2
Change extension name form DevTools to "Nobody DevTools"
0.0.1
Initial release of DevTools extension featuring:
- Path copying commands (absolute, relative with/without workspace, filename with/without extension)
- Comment tagging functionality with dynamic language detection and separate start/end placeholders
- %DATE% placeholder support with YYYY/MM/DD format
- Configurable settings for all commands
- Context menu integration for file explorer and editor tabs
Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
Enjoy!