我做了一个 Godot Files for Zed,把 Godot 项目里常见文件的编辑体验补进 Zed。
开发了一个 zed 的 godot 插件
/ 2 min read
目录
我做了一个 Godot Files for Zed,把 Godot 项目里常见文件的编辑体验补进 Zed。
扩展为 GDScript、GDShader、场景、资源和 UID 文件提供语法支持。打开场景或资源时,res://、uid://、ExtResource 和 SubResource 引用可以跳转;悬浮信息会显示解析到的资源路径、类型和图片预览。资源服务用 Rust 编写,索引项目中的 UID 和导入信息。
GDScript 的补全和诊断通过 Godot 编辑器自带的 Language Server 提供,因此使用时需要让 Godot 打开对应项目。GDScript 调试连接 Godot 的调试端口。
C# 语言支持交给 Zed 官方 C# 扩展,调试使用 zed-netcoredbg。GDShader 也可以选择启用独立的 gdshader-lsp-cpp,提供诊断、补全等功能;它默认关闭,避免没有安装后端时影响其他文件支持。
不同服务各自负责擅长的部分:
- Tree-sitter 提供语法解析和高亮
- gdfiles-lsp 负责 Godot 资源导航
- 外部语言服务(C#、 GDScript)负责代码智能
Thanks
- zed-gdscript — original extension.
- zed-csharp and zed-netcoredbg — C# language features and .NET debugging.
- Godot Files for VS Code — resource navigation and preview reference.
- tree-sitter-gdscript and tree-sitter-godot-resource — Godot grammars.
- tree-sitter-gdshader — GDShader grammar and highlight queries.
- gdshader-lsp-cpp — optional GDShader language server.
- Zed extension API and lsp-server — editor integration and LSP transport.
- image and resvg — image decoding and SVG rendering.