Go to file
wanjia 4a187e3a81 chore(release): 0.2.3 VSIX built, description updated with 5 LLM backends 2026-06-30 10:29:13 +08:00
config fix: add LLM test connection, register review/export commands, secrets.example.json 2026-06-08 16:50:15 +08:00
docs docs: update PENDING_ITEMS — mark TD-03 (mutex) and GAP-04 (F5 debug) done 2026-06-26 17:18:18 +08:00
iterations docs: v0.2 上午工作回顾 — 迭代/记忆/CHANGELOG 同步 2026-05-27 13:40:13 +08:00
knowledge refactor: 移除不可靠的 guessPhonetic() + 新增 Fallback 原则(宪章§18) 2026-05-27 10:32:55 +08:00
packages chore(release): 0.2.3 VSIX built, description updated with 5 LLM backends 2026-06-30 10:29:13 +08:00
skills docs(skills): 新增 Git Conventional Commits 提交规范 Skill 2026-05-26 15:09:29 +08:00
.eslintrc.json feat: VibeCoding English v0.1.0 - Full project initialization 2026-05-26 15:01:41 +08:00
.gitignore feat: VibeCoding English v0.1.0 - Full project initialization 2026-05-26 15:01:41 +08:00
.prettierrc feat: VibeCoding English v0.1.0 - Full project initialization 2026-05-26 15:01:41 +08:00
AGENTS.md feat: VibeCoding English v0.1.0 - Full project initialization 2026-05-26 15:01:41 +08:00
CHANGELOG.md chore(release): 0.2.3 — MEMORY, CHANGELOG, ROADMAP updated with today's 17 fixes 2026-06-26 17:17:55 +08:00
LICENSE feat: v0.2.1 trial release - sentence translation, context capture, docs, vsix packaging 2026-06-05 16:56:36 +08:00
MEMORY.md chore(release): 0.2.3 — MEMORY, CHANGELOG, ROADMAP updated with today's 17 fixes 2026-06-26 17:17:55 +08:00
PRD.md feat: VibeCoding English v0.1.0 - Full project initialization 2026-05-26 15:01:41 +08:00
PROJECT_CONSTITUTION.md refactor: 移除不可靠的 guessPhonetic() + 新增 Fallback 原则(宪章§18) 2026-05-27 10:32:55 +08:00
README.md fix: add README/icon to VSIX, improve settings UX, LLM provider presets 2026-06-08 15:39:07 +08:00
package-lock.json feat: v0.2.1 trial release - sentence translation, context capture, docs, vsix packaging 2026-06-05 16:56:36 +08:00
package.json feat: VibeCoding English v0.1.0 - Full project initialization 2026-05-26 15:01:41 +08:00
tsconfig.base.json feat: VibeCoding English v0.1.0 - Full project initialization 2026-05-26 15:01:41 +08:00

README.md

VibeCoding English

面向中国程序员的 Vibe Coding 英语学习 VS Code 插件 —— 选中即翻译,编码中学英语。

Version VS Code


🎯 一句话

在 VS Code 中选中英文单词/句子即可翻译自动积累到单词本SM-2 间隔复习。无感查词,编码中自然提升英语能力。


核心功能

🔤 全场景翻译

场景 操作 说明
编辑器内 鼠标 Hover ↔ 悬浮翻译 自动检测英文单词,显示音标 + 释义 + 例句
编辑器选中 Ctrl+Shift+T 翻译选中单词/短语/整句
剪贴板 Ctrl+Shift+Y 翻译剪贴板内容Agent 面板复制后使用)
终端 Ctrl+点击 终端中点击英文单词翻译
整句翻译 选中句子 → Ctrl+Shift+T LLM 直接翻译为流畅中文
右键菜单 右键 → 翻译选中单词 编辑器内右键菜单入口

📖 智能单词本

  • 自动积累:翻译后一键加入单词本,携带上下文句子 + 来源标记
  • 上下文捕获
    • 编辑器 → 单词所在位置前后 N 行
    • CodeBuddy 会话 → 自动读取 check-point 文件
    • 终端 → 单词所在终端行
    • 剪贴板 → 历史回溯匹配大段文本
  • 中文释义LLM 自动翻译上下文句子
  • 关键字高亮:上下文中目标单词黄色高亮

🧠 SM-2 间隔复习

  • 基于 Anki 同款 SM-2 算法
  • 复习卡片:翻转判断 Again / Hard / Good / Easy
  • Anki CSV 导出

🎛️ 可配置

  • Webview 设置面板LLM Provider / API Key / Endpoint / Model
  • 引擎开关LLM Agent / 百度 / 有道 / 离线
  • UI 开关Hover 翻译 / 剪贴板监听 / 复习提醒

⌨️ 快捷键

快捷键 功能
Ctrl+Shift+T 翻译选中单词/句子
Ctrl+Shift+G 上下文翻译(带编辑器中前后文)
Ctrl+Shift+Y 翻译剪贴板内容
Ctrl+Shift+W 直接加入单词本(不触发翻译)
Ctrl+Shift+B 打开单词本
Ctrl+Shift+P → 搜索命令 打开设置 / 单词复习 / 导出

🚀 快速开始

1. 安装

# 下载 .vsix 文件后
code --install-extension vibecoding-english-0.2.1.vsix

2. 配置 LLM可选但推荐

打开 VCE Settings 面板,填入 LLM 配置:

{
  "llmProvider": "openai",
  "llmEndpoint": "http://your-llm-endpoint/v1",
  "llmModel": "gpt-4o-mini",
  "llmApiKey": "your-api-key"
}

或在 config/secrets.json 中填写gitignored

{
  "llm": {
    "provider": "custom",
    "endpoint": "http://js2.blockelite.cn:17865/v1",
    "model": "qwen3.6-int4-AWQ"
  },
  "baidu": {
    "appId": "你的百度翻译AppID",
    "appKey": "你的百度翻译Key"
  }
}

3. 开始使用

  1. 在代码编辑器中,鼠标悬停英文单词 → 自动翻译
  2. 选中英文单词 → Ctrl+Shift+T → 看翻译结果
  3. 点击 📖 加入单词本 → 保存到单词本
  4. Ctrl+Shift+B 打开单词本查看

🏗️ 架构

packages/
├── core/                    # 平台无关核心库
│   ├── src/translate/       # 翻译引擎LLM / 百度 / 离线)
│   ├── src/wordbook/        # 单词本 + SM-2 复习
│   ├── src/llm/             # LLM Client + Prompts
│   └── src/utils/           # 缓存 / 事件总线 / 日志
│
└── adapter-vscode/          # VS Code 适配器
    ├── src/providers/       # Hover / Terminal / Clipboard / CodeBuddy
    ├── src/ui/              # Webview HTML (单词本 / 设置)
    └── src/extension.ts     # 入口 + 命令注册

翻译引擎架构

LLM Agent (Qwen 主引擎) → 百度 API (降级) → 离线词库 (兜底)

📦 构建

# 安装依赖
npm install

# 编译
npm run build

# 打包 VSIX
npm run package

🤝 贡献

欢迎提交 Issue 和 PR。

Commit 规范:使用 Conventional Commits

代码风格TypeScript strict mode禁止 any,所有公共 API 有 JSDoc。

详见 AGENTS.md多 Agent 协作定义)和 PROJECT_CONSTITUTION.md项目宪章


📋 已知限制

限制 说明
Hover 不支持多词短语 getWordRangeAtPosition API 限制
终端不支持多词短语 Ctrl+点击 \b 单词边界限制
CodeBuddy 上下文仅 coding 会话 聊天对话无 check-point 文件
第三方 Agent WebView 无法读取 VS Code 扩展沙盒隔离

详见项目 ROADMAP 中的 Known Limitations 章节。


📄 License

MIT