GeWuYou 4c6deb4097 feat(vscode-extension): 添加 GFramework 配置工具扩展
- 创建 VS Code 扩展用于浏览、验证和编辑 GFramework 项目的配置文件
- 实现配置文件浏览器视图和相关命令功能
- 添加 YAML 文件和匹配模式文件的打开功能
- 实现嵌套对象字段的轻量级表单预览功能
- 添加批量编辑配置域的功能
- 集成轻量级模式验证支持
- 创建 GitHub Actions 工作流用于打包和发布扩展
- 配置扩展的激活事件和菜单贡献点
- 设置工作区配置选项用于指定配置和模式路径
2026-04-01 22:58:47 +08:00

1.8 KiB

GFramework Config Tool

VS Code extension for the GFramework AI-First config workflow.

Current MVP

  • Browse config files from the workspace config/ directory
  • Open raw YAML files
  • Open matching schema files from schemas/
  • Run lightweight schema validation for nested required fields, unknown nested fields, scalar types, scalar arrays, and arrays of objects
  • Open a lightweight form preview for nested object fields, object arrays, top-level scalar fields, and scalar arrays
  • Batch edit one config domain across multiple files for top-level scalar and scalar-array fields
  • Surface schema metadata such as title, description, default, enum, and x-gframework-ref-table in the lightweight editors

Validation Coverage

The extension currently validates the repository's minimal config-schema subset:

  • required properties in nested objects
  • unknown properties in nested objects
  • scalar compatibility for integer, number, boolean, and string
  • scalar arrays with scalar item type checks
  • arrays of objects whose items use the same supported subset recursively
  • scalar enum constraints and scalar-array item enum constraints

Local Testing

cd tools/vscode-config-extension
bun install
bun run test

Packaging And Publishing

cd tools/vscode-config-extension
bun install
bun run package:vsix
VSCE_PAT=your_marketplace_pat bun run publish:marketplace

Current Constraints

  • Multi-root workspaces use the first workspace folder
  • Validation only covers a minimal subset of JSON Schema
  • Form preview supports object-array editing, but nested object arrays inside array items still fall back to raw YAML
  • Batch editing remains limited to top-level scalar fields and top-level scalar arrays

Workspace Settings

  • gframeworkConfig.configPath
  • gframeworkConfig.schemasPath