1.8 KiB
1.8 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is a VSCode extension plugin for translating between Chinese and English variable names. It translates selected Chinese text to English variable names and vice versa, with support for multiple naming conventions (camelCase, PascalCase, snake_case).
Architecture
- Core Extension:
src/extension.ts- Main VSCode extension entry point - Translation Service:
src/translationService.ts- Handles Google Translate and Baidu Translate API integrations - Naming Formatter:
src/namingFormatter.ts- Converts translated text to proper variable naming conventions
Build Commands
npm run compile- Compile TypeScript to JavaScriptnpm run watch- Watch mode for developmentnpm run vscode:prepublish- Pre-publish compilation
Development Setup
- Install dependencies:
npm install - Compile TypeScript:
npm run compile - Press F5 in VSCode to launch Extension Development Host
- Test commands:
Ctrl+Alt+E(translate to English),Ctrl+Alt+C(translate to Chinese)
Key Configuration Settings
translate.namingConvention: Variable naming style (camelCase/PascalCase/snake_case)translate.translationService: Translation provider (google/baidu)translate.baiduAppId: Baidu API app IDtranslate.baiduSecretKey: Baidu API secret key
Extension Commands
translate.toEnglish: Translate selected Chinese text to English variable nametranslate.toChinese: Translate selected English text to Chinese
File Structure
src/- TypeScript source filesout/- Compiled JavaScript outputdocs/design.md- Design documentation in Chinesepackage.json- Extension manifest with commands and configuration