目录
目录README.md

CombatCode

AI-Powered High-Performance Code Editor

License: MIT Build Status TypeScript React

FeaturesInstallationDocumentationContributingLicense


Table of Contents


Overview

CombatCode is a next-generation code editor that combines the power of AI assistance with high-performance editing capabilities. Built with modern web technologies and a Rust backend, it provides an unparalleled coding experience.

Key Highlights

  • 🚀 Blazing Fast - Optimized for large files with virtual scrolling and object pooling
  • 🤖 AI-Powered - Intelligent code completion, refactoring, and assistance
  • 🔒 Type-Safe - Built with TypeScript for reliable development
  • 📊 Performance Monitoring - Built-in tools to track and optimize performance
  • 🎨 Modern UI - Beautiful, responsive interface with dark mode support
  • 🔌 Extensible - Plugin-based architecture for custom functionality

Features

🎯 Core Features

  • Advanced Editor

    • Multi-cursor editing with optimized performance
    • Code folding with lazy computation
    • Syntax highlighting for 100+ languages
    • Intelligent auto-completion
    • Keyboard shortcut customization
  • AI Integration

    • Code completion powered by AI models
    • Intelligent refactoring suggestions
    • Natural language code generation
    • Context-aware assistance
  • Performance Optimization

    • Virtual scrolling for large files (10k+ lines)
    • Object pooling to reduce GC pressure
    • Debounced state updates
    • Web Workers for heavy computations
    • GPU-accelerated operations
  • Developer Tools

    • Real-time performance monitoring dashboard
    • Technical debt tracking system
    • Symbol indexing and navigation
    • Integrated debugging tools

📁 File Management

  • DDD-based file management architecture
  • Efficient file operations with IndexedDB persistence
  • Large file support (>100MB files)
  • Auto-save with conflict resolution
  • File history and version tracking
  • Symbol-based navigation
  • Outline view for files
  • Go to definition
  • Find references
  • Smart search across files

🎨 User Interface

  • Modern, responsive design
  • Compact and full dashboard modes
  • Dark/light theme support
  • Customizable keyboard shortcuts
  • Multi-layout support

Technology Stack

Frontend

Technology Version Description
React 19.0 UI component library
TypeScript 5.7.3 Type-safe JavaScript
CodeMirror 6.x Editor framework
Tauri 2.9.5 Desktop application framework
Vite Latest Build tool and dev server
Tailwind CSS Latest Utility-first CSS framework
Biome Latest Fast linter and formatter

Backend

Technology Version Description
Rust Latest Systems programming
Tauri 2.9.5 Backend framework
Tokio Latest Async runtime
Serde Latest Serialization

Storage

  • IndexedDB - Large dataset persistence
  • localStorage - Configuration and preferences
  • File System - Project files

Installation

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js >= 18.0.0
  • pnpm >= 8.0.0
  • Rust >= 1.70.0
  • Tauri CLI >= 2.0.0

Install Dependencies

  1. Clone the repository
git clone https://github.com/your-org/CombatCode.git
cd CombatCode
  1. Install dependencies
pnpm install
  1. Initialize Tauri
pnpm run tauri setup

Build from Source

# Development mode
pnpm run dev

# Production build
pnpm run build

# Build Tauri app
pnpm run tauri build

Quick Start

Running the Application

# Start development server
pnpm run dev

# The app will open automatically
# or navigate to http://localhost:1420

Basic Usage

  1. Open a file
// Using the file service
import { fileService } from '@/services';

const result = await fileService.openFile('/path/to/file.ts');
if (result.isOk()) {
  const file = result.value;
  console.log(file.getContent());
}
  1. Edit with AI assistance
// Get AI completion
import { aiManager } from '@/services/ai';

const completions = await aiManager.getCodeCompletion(
  editor,
  position
);
  1. Monitor performance
// Enable performance monitoring
import { usePerformanceMonitoring } from '@/hooks';

const { metrics, isMonitoring } = usePerformanceMonitoring({
  autoStart: true,
  updateInterval: 1000,
});

console.log('FPS:', metrics.fps);
console.log('Memory:', metrics.memory.used);

Configuration

Create a .env file in the root directory:

# API Keys
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-...

# Development
DEV_MODE=true
LOG_LEVEL=debug

# Features
ENABLE_AI_FEATURES=true
ENABLE_GPU_ACCELERATION=true
ENABLE_TELEMETRY=false

Documentation

Architecture

API Documentation

Feature Documentation

Project Reports


Development

Project Structure

CombatCode/
├── src/                    # Frontend source code
│   ├── components/         # React components
│   │   ├── editor/        # Editor components
│   │   ├── ui/            # Reusable UI components
│   │   └── dashboard/     # Dashboard components
│   ├── hooks/             # Custom React hooks
│   ├── services/          # Business services
│   ├── domain/            # Domain layer (DDD)
│   ├── utils/             # Utility functions
│   └── shared/            # Shared utilities
├── src-tauri/             # Rust backend
│   ├── src/
│   │   ├── commands/      # Tauri commands
│   │   ├── services/      # Backend services
│   │   └── utils/         # Rust utilities
│   └── Cargo.toml         # Rust dependencies
├── docs/                  # Documentation
├── tests/                 # Test files
├── plans/                 # Project plans
└── public/                # Static assets

Development Workflow

  1. Create a feature branch
git checkout -b feature/my-feature
  1. Make changes and commit
git add .
git commit -m "feat: add my new feature"
  1. Run tests
pnpm run test
pnpm run type-check
  1. Push and create PR
git push origin feature/my-feature

Running Tests

# Run all tests
pnpm run test

# Run tests in watch mode
pnpm run test:watch

# Run tests with coverage
pnpm run test:coverage

# Type check
pnpm run type-check

# Lint code
pnpm run lint

Code Quality

We use Biome for code quality:

# Format code
pnpm run format

# Check formatting
pnpm run format:check

# Lint code
pnpm run lint

# Fix linting issues
pnpm run lint:fix

Contributing

We welcome contributions! Please see our Contributing Guide for details.

How to Contribute

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Write/update tests
  5. Ensure all tests pass
  6. Submit a pull request

Contribution Guidelines

  • Follow the coding standards
  • Write tests for new features
  • Update documentation
  • Keep changes small and focused
  • Write clear commit messages

Reporting Issues

When reporting issues, please include:

  • Clear description of the problem
  • Steps to reproduce
  • Expected vs actual behavior
  • Environment details (OS, Node.js version, etc.)
  • Screenshots if applicable

Performance

Benchmarks

Feature Before After Improvement
Virtual Scrolling (10k lines) 2500ms 350ms 7.1x faster
Multi-Cursor (100 cursors) 180ms 48ms 3.75x faster
Code Folding 1200ms 130ms 9.2x faster
Memory Usage 450MB 120MB 73% reduction
FPS (large file) 15 FPS 58 FPS 3.9x improvement

Optimization Techniques

  • Virtual Scrolling - Only render visible items
  • Object Pooling - Reuse DOM widgets
  • Debouncing - Reduce state update frequency
  • Lazy Loading - Defer expensive operations
  • Web Workers - Offload heavy computations
  • GPU Acceleration - Use GPU for parallel tasks

Roadmap

Current Version: v0.5.0

Completed ✅

  • Virtual scrolling for large files
  • Multi-cursor editing
  • Code folding system
  • Performance monitoring dashboard
  • Technical debt management
  • DDD architecture refactoring
  • Dependency automation

In Progress 🚧

  • AI completion integration
  • Symbol indexing
  • Advanced search functionality

Planned 📋

  • Real-time collaboration
  • Git integration
  • Remote development support
  • Plugin system
  • Language server protocol support

FAQ

Q: How do I add support for a new language?

A: See the Language Support Guide for instructions on adding syntax highlighting and language-specific features.

Q: Can I use CombatCode without AI features?

A: Yes! AI features are optional. Set ENABLE_AI_FEATURES=false in your .env file.

Q: How do I customize keyboard shortcuts?

A: Create a custom keyboard shortcut configuration. See the Customization Guide for details.

Q: Is CombatCode free?

A: Yes! CombatCode is open-source and free to use under the MIT license.

Q: What are the system requirements?

A:

  • OS: Windows 10+, macOS 10.15+, or Linux
  • RAM: 4GB minimum, 8GB recommended
  • Storage: 500MB for installation
  • CPU: Modern processor with SSE4.2 support

Troubleshooting

Common Issues

Issue: “Cannot find module ‘@/‘“

Solution: Ensure your tsconfig.json has the correct path mapping:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  }
}

Issue: Tauri app won’t start

Solution: Try these steps:

# Clean build
rm -rf src-tauri/target
pnpm run tauri build

# Reset Tauri
pnpm run tauri setup

Issue: Out of memory errors

Solution: Increase Node.js memory limit:

NODE_OPTIONS="--max-old-space-size=8192" pnpm run dev

For more issues, check the Troubleshooting Guide.


Community

Get Involved

Support


License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2025 CombatCode Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Acknowledgments

Dependencies

This project wouldn’t be possible without these amazing open-source projects:

Contributors

Thanks to all the people who have contributed to CombatCode:

Special Thanks

  • The CodeMirror team for the excellent editor framework
  • The Tauri team for making Rust + Web possible
  • The TypeScript team for the amazing type system
  • All our beta testers for valuable feedback

Star History

Star History Chart

Built with ❤️ by the CombatCode team

⬆ Back to Top

关于
6.3 GB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号