Write once. Deploy Everywhere.
Official VSCode extension for the LUMOS schema language - a type-safe, cross-language schema definition language for Solana development.
Beautiful syntax highlighting for .lumos files with support for:
- Keywords (
struct,enum,pub, etc.) - Primitive types (
u8,u64,String, etc.) - Solana types (
PublicKey,Signature,Keypair) - Attributes (
#[solana],#[account],#[key],#[max(n)]) - Comments (line and block)
- Numbers (decimal, hex, binary, octal)
Quick snippets for common patterns:
solstruct- Solana structsolaccount- Solana account structenumu- Unit enum (state machines)enumt- Tuple enum (data-carrying variants)enums- Struct enum (Solana instruction pattern)- Field shortcuts:
fpubkey,fu64,fstring,farray,foption - Attributes:
max,key
- LUMOS: Generate Code - Generate Rust and TypeScript from current schema
- LUMOS: Validate Schema - Validate the current
.lumosfile
lumos.validation.enabled- Enable/disable schema validation (default:true)lumos.codeGeneration.autoGenerate- Auto-generate code on save (default:false)
To use code generation features, you need to have the LUMOS CLI installed:
cargo install lumos-cliOr build from source:
git clone https://github.com/RECTOR-LABS/lumos
cd lumos/packages/cli
cargo install --path .- Create a new file with
.lumosextension - Start typing and enjoy syntax highlighting!
- Use snippets for quick scaffolding (e.g., type
solstructand press Tab)
Example:
#[solana]
#[account]
struct UserAccount {
wallet: PublicKey,
balance: u64,
items: [PublicKey],
}
#[solana]
enum GameState {
Active,
Paused,
Finished,
}
Option 1: Command Palette
- Open a
.lumosfile - Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "LUMOS: Generate Code" and press Enter
Option 2: Auto-generate on Save
- Enable in settings:
"lumos.codeGeneration.autoGenerate": true - Save your
.lumosfile - Code is automatically generated!
This extension contributes the following settings:
lumos.validation.enabled: Enable/disable LUMOS schema validationlumos.codeGeneration.autoGenerate: Automatically generate Rust/TypeScript on save
- Language server features (advanced IntelliSense, real-time validation) are planned for future releases
Initial release of LUMOS VSCode extension:
- ✅ Syntax highlighting for
.lumosfiles - ✅ Code snippets for common patterns
- ✅ Bracket matching and auto-closing
- ✅ Comment toggling
- ✅ Code generation commands
- ✅ Auto-generate on save option
Found a bug or have a feature request? Please open an issue on GitHub.
MIT OR Apache-2.0
Enjoy! 🚀