Expand Gotlin language and tooling

This commit is contained in:
pavel 2026-08-27 01:46:57 +02:00
commit de1262b4cf
41 changed files with 6059 additions and 379 deletions

View file

@ -1,58 +1,47 @@
# vscode-gotlin
# Gotlin for VS Code
Minimal VS Code extension for `.gt` files.
VS Code language support for Gotlin (`.gt`) files.
It does two things:
## Features
- registers `.gt` as the `gotlin` language
- launches `gotlin-lsp` over stdio
- TextMate highlighting for current Gotlin declarations, control flow, concurrency, exceptions, types, annotations, pointers, nullable types, generics, and numeric literals
- Dedicated highlighting for the typed `sql` DSL and its query, mutation, and execution methods
- Go import highlighting for bare dotted paths, aliases, and quoted module paths
- Bracket matching, indentation, folding markers, comments, and editor pairs
- Snippets for data classes, SQL table rows and operations, workers, embeds, concurrency, defer, and foreach loops
- `gotlin-lsp` integration, including its optional `gopls` bridge for Go-imported symbols
It also includes:
## Development
- syntax highlighting
- bracket/comment configuration
- basic Gotlin snippets
- optional `gopls` bridge for hover/definition on Go-imported symbols
## Setup
From this folder:
From this directory:
```bash
npm install
npm run build
npm run check
```
Then in VS Code:
`npm run build` compiles the extension and `npm test` validates all JSON contribution files plus key current grammar tokens and snippets without additional test dependencies.
1. Open this folder as an extension project.
2. Press `F5` to launch an Extension Development Host.
3. Open your Gotlin workspace in that host.
To run the extension, open this directory in VS Code and press `F5`. In the Extension Development Host, open a Gotlin workspace containing `.gt` files.
## Server path
## Language Server
By default the extension looks for:
```text
<workspace>/bin/gotlin-lsp
```
If your binary lives somewhere else, set:
The extension first looks for the platform-specific server binary at `<workspace>/bin/gotlin-lsp`, then falls back to `gotlin-lsp` on `PATH`. Override it with:
```json
"gotlin.serverPath": "/absolute/path/to/gotlin-lsp"
```
If `gopls` is not on your PATH, also set:
If `gopls` is not on `PATH`, configure:
```json
"gotlin.goplsPath": "/absolute/path/to/gopls"
```
## Build the language server
From the repo root:
Build the language server from the repository root with:
```bash
go build -o ./bin/gotlin-lsp ./cmd/gotlin-lsp
```
The extension activates when a Gotlin document is opened and communicates with the server over stdio.