This commit is contained in:
Pavel Flegr 2026-03-05 14:55:09 +01:00
commit 8f4f858d86
30 changed files with 9765 additions and 0 deletions

39
cmd/gotlin-lsp/README.md Normal file
View file

@ -0,0 +1,39 @@
# gotlin-lsp
Minimal stdio language server for `.gt` files.
Current support:
- `initialize`
- `shutdown`
- `exit`
- `textDocument/didOpen`
- `textDocument/didChange`
- `textDocument/didClose`
- publish diagnostics from the existing Gotlin parser/code generator
- `textDocument/hover` for packages, imports, and top-level functions
- `textDocument/definition` for imported namespaces and top-level functions
- simple semantic diagnostics for duplicate imports/functions and undefined names
- optional fallback to `gopls` for hover/definition on Go-imported symbols
Build:
```bash
go build -o ./bin/gotlin-lsp ./cmd/gotlin-lsp
```
Use your editor's custom LSP configuration to launch:
```bash
./bin/gotlin-lsp
```
## gopls bridge
If `gopls` is installed, `gotlin-lsp` will try to use it as a fallback for hover and definition on Go-imported symbols.
You can set an explicit path with:
```bash
GOTLIN_GOPLS_PATH=/absolute/path/to/gopls ./bin/gotlin-lsp
```