Odin language template
- Utilize Odin language server
- Configure Sublime build system
- Ensure no memory leaks through use of tracking allocator
Editor configuration for Sublime Text
Contents of %APPDATA%\Sublime Text\Packages\User\Odin.sublime-build
{
"selector": "source.odin",
"file_regex": "^(.+)\\(([0-9]+):([0-9]+)\\) (.+)$",
"file_patterns": ["*.odin"],
"shell_cmd": ["odin check ."],
"variants": [
// build
{"name":"build", "shell_cmd":"odin build ."},
// check
{"name":"check", "shell_cmd":"odin check ."},
// run
{"name":"run", "shell_cmd":"odin run ."},
// test
{"name":"test", "shell_cmd":"odin test ."},
]
}Contents of %APPDATA%\Sublime Text\Packages\User\LSP.sublime-settings
// Settings in here override those in "LSP/LSP.sublime-settings"
{
"clients": {
"odin": {
"command": [
"C:\\path\\ols\\ols.exe"
],
"enabled": false, // true for globally-enabled, but not required due to 'Enable In Project' command
"selector": "source.odin",
"initializationOptions": {
"enable_semantic_tokens": true,
"enable_document_symbols": true,
"enable_hover": true,
"enable_snippets": true,
"enable_format": true,
}
}
}
}Set ODIN_ROOT environment variable to path of Odin directory (which contains core and vendor libraries).
# from Windows cmd prompt
rundll32 sysdm.cpl,EditEnvironmentVariables