LazyCodet Helper
A collection of helpful tools for developers to improve productivity
Introduction
LazyCodet Helper is a Visual Studio Code extension crafted to enhance developer productivity by simplifying repetitive tasks, starting with seamless code sharing for AI chatbots. In today’s development landscape, where developers frequently share code snippets or project structures with AI assistants for tasks like debugging or analysis, LazyCodet Helper provides efficient tools to copy file contents and generate folder trees. With configurable options for ignoring directories, customizing tree styles, and defining code file extensions, LazyCodet Helper delivers clean, chatbot-ready outputs. While currently focused on these core features, LazyCodet Helper is designed to evolve, with plans to introduce additional functionalities to streamline and accelerate common development workflows.
Purpose
LazyCodet Helper aims to empower developers by reducing the time and effort spent on routine tasks. Its initial focus is on simplifying the process of preparing and sharing codebases with AI-driven tools, such as chatbots for debugging, code reviews, or explaining project structures. By offering quick, formatted file content copying and clear folder hierarchy visualization, LazyCodet Helper enhances efficiency. Looking ahead, LazyCodet Helper will expand to include a broader range of features, all geared toward making development faster, more convenient, and more intuitive.
Features
1. Smart Copy Content
- Command:
lazycodet.copyContent
- Description: Copies the content of selected files or folders to the clipboard in a formatted manner.
- Behavior:
- For files, it copies the file content with the relative path.
- For folders, it recursively copies the content of all code files, excluding ignored directories.
- Ignores non-code files (based on file extensions like
.js
, .ts
, .py
, etc.).
- Shows a progress bar for multiple selections.
- Provides feedback on the number of files copied and ignored directories.
- Supported Inputs:
- Single file ✔
- Single folder ✔
- Multiple files ❌
- Multiple folders ❌
- Mixed files and folders ❌
The inability to handle multiple files, multiple folders, or mixed files and folders arises because VS Code does not provide an official API to detect when users change their selection in the Explorer. This limitation prevents LazyCodet Helper from receiving updates about changes in the user's multi-selection context, thereby affecting its functionality for these scenarios.
2. Copy Folder Tree
- Command:
lazycodet.copyFolderTree
- Description: Copies the folder structure as a text representation to the clipboard.
- Supported Inputs:
- Single folder
- Multiple folders
- Workspace root (if no folder is selected)
- Styles:
- Emoji: Uses emoji icons (📁 for folders, 📄 for files).
- ASCII: Uses ASCII characters for a tree-like structure.
- Behavior:
- Ignores configured directories.
- Sorts entries (directories first, then files, alphabetically).
- Shows a progress bar for multiple folders.
- Provides feedback on ignored directories.
3. Configuration
- Command:
lazycodet.configureIgnoreDirs
- Description: Opens an input box to configure directories to ignore when copying content or folder trees.
- Settings:
- Ignored Directories (
lazycodet.ignoredDirectories
):
- Type: Array of strings
- Default:
["node_modules", ".git", "dist", "build", ".next", ".nuxt", "out", ".github", ".vscode"]
- Description: Specifies directories to ignore when copying folder content.
- Ignored Files (
lazycodet.ignoredFiles
):
- Type: Array of strings
- Default:
["package-lock.json", "pnpm-lock.yaml", "composer.lock", "yarn.lock", "README.md", "readme.md"]
- Description: Specifies files to ignore when copying folder content.
- Folder Tree Style (
lazycodet.folderTreeStyle
):
- Type: String (enum:
"emoji"
, "ascii"
)
- Default:
"ascii"
- Description: Defines the style for the folder tree structure (emoji icons or ASCII characters).
Installation
- Open VS Code.
- Go to the Extensions view (
Ctrl+Shift+X
or Cmd+Shift+X
on Mac).
- Search for
LazyCodet Helper
.
- Click Install.
Usage
Copying Content
- Right-click on a file or folder in the Explorer.
- Select Copy Content from the context menu.
- Alternatively, use the Command Palette (
Ctrl+Shift+P
or Cmd+Shift+P
):
- Type
LazyCodet: Copy Content
and press Enter.
- The content is copied to the clipboard with relative paths and formatted code blocks.
Copying Folder Tree
- Right-click on a folder in the Explorer.
- Select Copy Folder Tree from the context menu.
- Alternatively, use the Command Palette:
- Type
LazyCodet: Copy Folder Tree
and press Enter.
- The folder structure is copied to the clipboard in the configured style.
Configuring Settings
Ignored Directories and Files
You can configure which directories and files to ignore during the content copying process:
"lazycodet.ignoredDirectories": {
"type": "array",
"default": ["node_modules", ".git", "dist", "build", ".next", ".nuxt", "_nuxt", "out", ".github", ".vscode"],
"description": "Directories to ignore when copying folder content"
},
"lazycodet.ignoredFiles": {
"type": "array",
"default": ["package-lock.json", "pnpm-lock.yaml", "composer.lock", "yarn.lock", "README.md", "readme.md"],
"description": "Files to ignore when copying folder content"
}
- Open the Command Palette (
Ctrl+Shift+P
or Cmd+Shift+P
).
- Type
LazyCodet: Configure Ignored Directories
and press Enter.
- Enter a comma-separated list of directories to ignore (e.g.,
node_modules, .git, dist
).
- Press Enter to save the settings.
To change the folder tree style:
- Go to File > Preferences > Settings.
- Search for
lazycodet.folderTreeStyle
.
- Select either
emoji
or ascii
from the dropdown.
Alternatively, you can edit the settings directly in the VS Code settings UI:
- Go to File > Preferences > Settings.
- Search for
LazyCodet Helper
.
- Modify the
Ignored Directories
array or Folder Tree Style
as needed.
Example Output
Smart Copy Content
<File name 1>
```
<content file 1>
```
<File name 2>
```
<content file 2>
```
Folder Tree (Emoji Style)
For a folder src
:
Folder: src
📁 utils/
📄 helper.js
📄 index.js
Folder Tree (ASCII Style)
For a folder src
:
src
├── index.js
└── utils/
└── helper.js
Requirements
- VS Code version 1.60.0 or higher
Support LazyCodet Helper
If you find LazyCodet Helper helpful, please consider supporting its development! You can make a donation via PayPal at paypal.me/tainguyen1287. Your contributions help keep this project alive and improve its features. Thank you!