TLang ships a full Language Server Protocol implementation and a Zed editor extension. The LSP provides completions, hover docs, go-to-definition, find references, rename, semantic tokens, signature help, and document formatting — all powered by the TLang compiler.
The TLang language server implements the following LSP features:
An official Zed extension is available in the zed-plugin/ directory of the TLang repository. Install the extension:
cd zed-plugin
zed --install-extension .
The extension registers the tlang-lsp language server, syntax grammar, and file association for .tlang files. After installation, open any .tlang file in Zed and the LSP starts automatically. To configure a custom binary path, add to ~/.config/zed/settings.json:
{
"lsp": {
"tlang-lsp": {
"binary": {
"path": "/path/to/tlang",
"args": ["lsp-server"]
}
}
}
}
A VS Code extension is not yet published to the marketplace. You can configure VS Code to use the TLang LSP manually via the vscode-languageclient extension. Add to your workspace .vscode/settings.json:
{
"tlang.server.path": "/path/to/tlang"
}
Or use the generic LSP client extension and point it at:
tlang lsp-server
The server communicates over stdin/stdout following the JSON-RPC 2.0 protocol.
JetBrains IDEs support external language servers via the LSP4IJ plugin. Install LSP4IJ from the JetBrains Marketplace, then configure it to run:
tlang lsp-server
for files matching the *.tlang pattern.
The server watches for file changes automatically. After rebuilding tlang, run tlang lsp-restart to pick up the new binary.
TLang ships a Tree-sitter grammar for editors that use it for syntax highlighting and structural selection. The grammar is at zed-plugin/tree-sitter-tlang/. It provides accurate highlighting for: