Code Merger
A VSCode extension for merging code files and removing comments and empty lines, optimized for AI code analysis and processing.
Features
- One-click merge of all code files in a folder
- Automatically removes comments and empty lines
- Generates clean merged code, perfectly optimized for AI analysis
- Supports one-click copy to clipboard for easy AI interaction
- Compatible with major AI platforms including DeepSeek, ChatGPT, Claude, and Gemini
- Optimized code structure for enhanced AI comprehension
Installation
- Search for "Code Merger" in VSCode Extension Marketplace
- Click Install
Or download the .vsix file and install manually:
code --install-extension code-merger-0.0.1.vsix
Usage
- Right-click on any folder or file in VSCode Explorer
- Select "Code Merger" from the context menu
- The extension will automatically merge the selected content and generate code without comments and empty lines
Examples
Merge Folder
Right-click on a folder and select "Code Merger", it will generate output in the following format:
----------------------------------------
File: src/main.js
import { createApp } from 'vue'
import App from './App.vue'
createApp(App).mount('#app')
----------------------------------------
File: src/components/HelloWorld.vue
<template>
<div class="hello">
<h1>{{ msg }}</h1>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
Merge Single File
Right-click on a single file to generate output without comments and empty lines:
----------------------------------------
File: package.json
{
"name": "my-project",
"version": "1.0.0",
"dependencies": {
"vue": "^3.0.0"
}
}
Supported File Types
- Common programming language files: .js, .ts, .py, .java, .cpp, etc.
- Web development files: .html, .css, .scss, etc.
- Configuration files: .json, .yaml, .ini, etc.
- Documentation files: .txt, .md
- Script files: .sh, .bat, .ps1
Notes
- Merging large projects may take some time
- Output will be displayed in both the output panel and clipboard
License
MIT License
| |