Go Model Description System
English | 中文
English
An AI-powered VS Code extension that helps you generate and manage comprehensive documentation for Go struct fields with context-aware analysis.
Features
Inlay Hints Integration
- Automatically detect Go struct fields in your code
- Display "Generate Doc" or "View Doc" buttons at the end of each field
- Individual action for each field
AI-Powered Generation
- Support for multiple AI providers:
- VS Code Language Model API (GitHub Copilot)
- OpenAI / Azure OpenAI
- Anthropic Claude
- Google Gemini
- Ollama (local models)
- Generates comprehensive documentation including:
- Business meaning and purpose
- Context and module information
- Read/write scenarios analysis
- Data flow sequence diagrams (Mermaid)
Documentation Management
- All documentation saved in
docs/model_descriptions.md
- Direct navigation to field documentation
- Organized by struct and field name
Usage
- Open a Go file with struct definitions
- Find the inlay hints at the end of struct fields
- Click:
- ✨ Generate Doc to create new documentation
- 📖 View Doc to view existing documentation
Configuration
Available settings in VS Code preferences:
model-desc-system.docsDirectory: Documentation directory (default: "docs")
model-desc-system.provider: AI provider selection
model-desc-system.openaiApiKey: API key for external providers
model-desc-system.apiBaseUrl: Custom API base URL
model-desc-system.modelName: Model name to use
Requirements
- VS Code 1.90.0 or higher
- Go language support
中文
一个基于 AI 的 VS Code 插件,用于辅助生成和管理 Go 结构体字段的业务说明文档,支持上下文感知分析。
功能特性
行内提示 (Inlay Hints)
- 自动识别 Go 代码中的结构体字段
- 在字段行尾显示"生成文档"或"查看文档"按钮
- 按钮针对每个字段独立存在
AI 辅助生成
- 支持多种 AI 提供商:
- VS Code 语言模型 API(GitHub Copilot)
- OpenAI / Azure OpenAI
- Anthropic Claude
- Google Gemini
- Ollama(本地模型)
- 生成全面的文档,包括:
- 业务含义和用途
- 上下文和模块信息
- 读写场景分析
- 数据流转时序图(Mermaid)
文档管理
- 所有文档保存在
docs/model_descriptions.md 文件中
- 点击可直接跳转到对应字段文档
- 按结构体和字段名组织
使用方法
- 打开包含结构体定义的 Go 文件
- 找到结构体字段尾部的行内提示
- 点击:
- ✨ 生成文档 创建新文档
- 📖 查看文档 查看已有文档
配置选项
在 VS Code 设置中可配置:
model-desc-system.docsDirectory: 文档目录(默认:"docs")
model-desc-system.provider: AI 提供商选择
model-desc-system.openaiApiKey: 外部提供商的 API 密钥
model-desc-system.apiBaseUrl: 自定义 API 地址
model-desc-system.modelName: 使用的模型名称
系统要求
- VS Code 1.90.0 或更高版本
- Go 语言支持
License
MIT
| |