|
| 1 | +# Godot Shader Language Server |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +External editor support for `.gdshader` files. |
| 7 | + |
| 8 | +> [!WARNING] |
| 9 | +> 🚧 Early Work in Progress |
| 10 | +> |
| 11 | +> This project is in its infancy and currently has no features. Feel free to ⭐ |
| 12 | +> the repo to track progress and signal to me that there is interest! |
| 13 | +
|
| 14 | +Godot's shader language is powerful, but editing `.gdshader` files outside the |
| 15 | +Godot editor is painful. This project aims to bring proper language tooling |
| 16 | +(autocomplete, hover, references, etc.) to editors like Neovim and VSCode. |
| 17 | + |
| 18 | +## 📦 Install |
| 19 | + |
| 20 | +Install from source: |
| 21 | + |
| 22 | +```shell |
| 23 | +go install github.com/armsnyder/gdshader-language-server@latest |
| 24 | +``` |
| 25 | + |
| 26 | +## ⚙️ Configure |
| 27 | + |
| 28 | +### Neovim |
| 29 | + |
| 30 | +Add the following to your `init.lua`, adjusting the path to the |
| 31 | +`gdshader-language-server` binary if necessary: |
| 32 | + |
| 33 | +```lua |
| 34 | +vim.api.nvim_create_autocmd("FileType", { |
| 35 | + pattern = "gdshader", |
| 36 | + callback = function() |
| 37 | + vim.lsp.start({ |
| 38 | + name = "gdshader", |
| 39 | + cmd = { vim.fs.expand('$HOME/go/bin/gdshader-language-server') }, |
| 40 | + }) |
| 41 | + end, |
| 42 | +}) |
| 43 | +``` |
| 44 | + |
| 45 | +### VSCode |
| 46 | + |
| 47 | +Coming soon? Contributions welcome! |
| 48 | + |
| 49 | +## Roadmap |
| 50 | + |
| 51 | +Planned features: |
| 52 | + |
| 53 | +- [ ] Go to definition |
| 54 | +- [ ] Find references |
| 55 | +- [ ] Formatting |
| 56 | +- [ ] Hover (show documentation) |
| 57 | +- [ ] Signature help |
| 58 | +- [ ] VSCode wrapper extension |
| 59 | + |
| 60 | +## 🤝 Contributing |
| 61 | + |
| 62 | +I love to see issues and pull requests! Just note that this is a side project |
| 63 | +for me, and I cannot promise to respond quickly. I will generally accept pull |
| 64 | +requests which are relevant to the project goals, are tested, and follow |
| 65 | +existing code conventions. |
| 66 | + |
| 67 | +### 📁 Code structure |
| 68 | + |
| 69 | +```graphql |
| 70 | +. |
| 71 | +├── main.go # Entry point |
| 72 | +└── internal |
| 73 | + ├── ast # .gdshader file parser library (application agnostic) |
| 74 | + ├── handler # Main application logic |
| 75 | + └── lsp # LSP server library (application agnostic) |
| 76 | +``` |
| 77 | + |
| 78 | +## License |
| 79 | + |
| 80 | +MIT |
0 commit comments