This project provides Odin programming language support, featuring syntax highlighting and code navigation via Tree-sitter, Language Server capabilities like autocompletion and diagnostics, and full debugging support.
- Tree Sitter: tree-sitter-odin
- Language Server: @DanielGavin/ols
- Debug Adapters: LLDB (Built-in)
This extension automatically updates to the latest OLS (Odin Language Server) monthly build on each startup.
If you want to use a specific OLS version or a locally built binary, you can override the automatic download:
{
"lsp": {
"ols": {
"binary": {
"path": "/path/to/your/ols",
"arguments": []
}
}
}
}The extension searches for the OLS binary in the following priority order:
- Custom binary path - If configured in settings (see above)
- System PATH - Checks if
olsis available in your system PATH - Cached binary - Uses previously downloaded version if available
- GitHub download - Downloads latest release from DanielGavin/ols
The extension attempts to automatically configure Odin collections (core, shared, vendor) if the odin binary is found in your PATH. User-configured collections always take precedence and are merged with auto-detected ones.
Add OLS configuration directly in your Zed settings.json. This approach works project-wide and doesn't require additional files:
Alternatively, create an ols.json file at the root of your workspace.For more configuration options, see the OLS documentation.
You can define custom code snippets to speed up your Odin development workflow.
- Open the command palette (
Cmd/Ctrl+Shift+P) - Run
snippets: configure snippets - Create or edit
odin.jsonin the snippets directory - Add your snippets in JSON format
Example snippet:
{
"Main procedure": {
"prefix": "main",
"body": [
"package main",
"",
"import \"core:fmt\"",
"",
"main :: proc() {",
"\t$0",
"}"
],
"description": "Creates a main package with imports"
}
}For detailed information about creating and using snippets, see Zed's snippet documentation.
This extension supports debugging Odin applications using LLDB.
{ "lsp": { "ols": { "initialization_options": { "enable_hover": true, "enable_snippets": true, "enable_procedure_snippet": true, "enable_completion_matching": true, "enable_references": true, "enable_document_symbols": true, "enable_format": true, "enable_document_links": true, // Optional: collections are auto-populated by default (core, shared, vendor) // Only specify if you want to override or add custom collections "collections": [ { "name": "core", "path": "/path/to/Odin/core" } ] } } } }