gotlin/tools/vscode-gotlin/README.md

1.7 KiB

Gotlin for VS Code

VS Code language support for Gotlin (.gt) files.

Features

  • 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, structured coroutines, embeds, defer, and foreach loops
  • gotlin-lsp integration, including its optional gopls bridge for Go-imported symbols

Development

From this directory:

npm install
npm run check

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.

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.

Language Server

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:

"gotlin.serverPath": "/absolute/path/to/gotlin-lsp"

If gopls is not on PATH, configure:

"gotlin.goplsPath": "/absolute/path/to/gopls"

Build the language server from the repository root with:

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.