Sublime Text package for LUMOS - Type-safe schema language for Solana development.
- Syntax Highlighting - Full syntax support for
.lumosfiles - LSP Integration - Auto-completion, diagnostics, hover documentation via
lumos-lsp - Snippets - Quick scaffolding for structs, enums, and Solana accounts
- Auto-Indentation - Smart indentation for LUMOS syntax
- Comment Toggling -
Ctrl+/(orCmd+/) to toggle line/block comments
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Run:
Package Control: Install Package - Search for:
LUMOS - Install
cd ~/Library/Application\ Support/Sublime\ Text/Packages
# or on Linux: ~/.config/sublime-text/Packages
git clone https://github.com/getlumos/sublime-lumos.git LUMOScd "%APPDATA%\Sublime Text\Packages"
git clone https://github.com/getlumos/sublime-lumos.git LUMOS- Open Command Palette
- Run:
Package Control: Add Repository - Enter:
https://github.com/getlumos/sublime-lumos - Run:
Package Control: Install Package - Select:
sublime-lumos
For full IDE features (auto-completion, diagnostics, hover, go-to-definition), you need:
-
Install LSP package (from Package Control):
- Open Command Palette →
Package Control: Install Package→LSP
- Open Command Palette →
-
Install lumos-lsp server:
cargo install lumos-lsp
The package includes LSP configuration out-of-the-box. After installing the LSP package and lumos-lsp server, restart Sublime Text.
Custom LSP Settings (optional):
Go to: Preferences → Package Settings → LSP → Servers → LSP-lumos
{
"clients": {
"lumos-lsp": {
"command": ["lumos-lsp"], // or full path: ["/path/to/lumos-lsp"]
"enabled": true
}
}
}- Open a
.lumosfile - Check the status bar (bottom-left) for
lumos-lspindicator - If green ✓ → LSP is working
- If red ✗ → Check LSP logs:
Tools→LSP→Troubleshoot Server
Type these triggers and press Tab:
| Trigger | Description | Output |
|---|---|---|
struct |
Basic struct | struct Name { field: u64 } |
enum |
Unit enum | enum Name { Variant1, Variant2 } |
enumtuple |
Tuple variant enum | enum Name { Variant(u64, String) } |
enumstruct |
Struct variant enum | enum Name { Variant { field: u64 } } |
account |
Solana account struct | #[solana] #[account] struct AccountName { ... } |
deprecated |
Deprecated field | #[deprecated("message")] field: Type |
Example Workflow:
- Type
account→ PressTab - Type account name → Press
Tab - Type field name → Press
Tab - Type field type → Done!
LUMOS package provides rich syntax highlighting for:
- Keywords:
struct,enum,use,pub,type,const - Primitive Types:
u8-u128,i8-i128,f32,f64,bool,String - Solana Types:
PublicKey,Pubkey,Signature,Keypair - Complex Types:
Vec<T>,Option<T>, arrays[T] - Attributes:
#[solana],#[account],#[version],#[deprecated] - Comments: Line (
//) and block (/* */) - Operators:
->,=>,::,<,> - Numbers: Decimal, hex (
0x), binary (0b), octal (0o)
Default settings are optimized for LUMOS development:
{
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true
}Override Settings:
Preferences → Settings - Syntax Specific (when editing a .lumos file)
| Shortcut | Action |
|---|---|
Ctrl+/ (or Cmd+/) |
Toggle line comment |
Ctrl+Shift+/ |
Toggle block comment |
Ctrl+Space |
Trigger auto-completion (LSP) |
Ctrl+Click |
Go to definition (LSP) |
Ctrl+K, Ctrl+I |
Show hover documentation (LSP) |
- Ensure file has
.lumosextension - Restart Sublime Text
- Check:
View→Syntax→LUMOS
-
Verify
lumos-lspis installed:which lumos-lsp # Should show path lumos-lsp --version -
Check LSP package is installed:
Preferences→Package Control→List Packages→ Look forLSP
-
Check LSP logs:
Tools→LSP→Toggle Log Panel- Look for errors related to
lumos-lsp
-
Restart LSP server:
- Open Command Palette →
LSP: Restart Servers
- Open Command Palette →
- Type the trigger word (e.g.,
struct) - Press
Tab(notEnter) - Ensure cursor is in a
.lumosfile
// NFT Metadata Account
#[solana]
#[account]
struct NftMetadata {
mint: PublicKey,
name: String,
symbol: String,
uri: String,
royalty_percentage: u16,
}
// NFT State
enum NftState {
Minted,
Listed { price: u64 },
Sold { buyer: PublicKey, price: u64 },
}
- lumos - Core compiler and CLI
- vscode-lumos - VS Code extension
- intellij-lumos - IntelliJ IDEA plugin
- nvim-lumos - Neovim plugin
- lumos-mode - Emacs mode
- docs-lumos - Official documentation
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes
- Push to the branch
- Open a Pull Request
Development:
- Test syntax changes: Edit
LUMOS.sublime-syntaxand reload Sublime Text - Test snippets: Edit
.sublime-snippetfiles insnippets/ - Report issues: GitHub Issues
Dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.
- Website: https://lumos-lang.org
- Documentation: https://docs.lumos-lang.org
- Repository: https://github.com/getlumos/sublime-lumos
- Issues: https://github.com/getlumos/sublime-lumos/issues
- LSP Server: https://crates.io/crates/lumos-lsp
Built with ❤️ by the LUMOS community