Write once. Deploy Everywhere.
Official VSCode extension for the LUMOS schema language - a type-safe, cross-language schema definition language for Solana development.
Full IDE support powered by lumos-lsp - Production-ready language server integration:
- β Real-time Diagnostics - Instant feedback on syntax errors, undefined types, and schema validation
- β
Intelligent Auto-completion - Context-aware suggestions for:
- Solana types (
PublicKey,Signature,Keypair) - Primitives (
u8-u128,i8-i128,bool,String) - Complex types (
Vec<T>,Option<T>) - Attributes (
#[solana],#[account],#[key],#[max],#[deprecated]) - Keywords (
struct,enum)
- Solana types (
- β Hover Documentation - Rich type information and inline documentation
- β Auto-install - One-click setup, no manual configuration needed
- π Future Features: Go to definition, find references, rename symbol
The LUMOS Language Server is battle-tested with 142 passing tests and provides a seamless, production-ready IDE experience.
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)
Bracket Matching:
- Highlights matching
{},[],(),<>pairs when cursor is adjacent - Jump to matching bracket with
Ctrl+Shift+\(Windows/Linux) orCmd+Shift+\(Mac) - Visual indicator for nested structures
Auto-Closing Pairs:
- Automatically closes
{,[,(,<,"when typed - Works intelligently - skips auto-closing inside strings
- Surrounds selected text when typing opening bracket
Smart Indentation:
- Auto-indents nested struct/enum definitions
- Decreases indent when typing closing bracket
- Handles multi-line field lists automatically
Code Folding:
- Fold/unfold code blocks with
Ctrl+Shift+[andCtrl+Shift+] - Support for
// #regionand// #endregionmarkers - Visual fold indicators in gutter
Example Usage:
// Type '{' and it auto-closes to '{}' with cursor inside struct Player {|} // Cursor positioned here automatically // Smart indentation for nested structures enum GameState { Active { players: Vec<PublicKey>, // Automatic indentation round: u32, // Bracket matching highlights pairs }, Paused, } // #region Core Types struct Position { x: i32, y: i32 } // #endregion 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)
The LUMOS Language Server (lumos-lsp) provides real-time diagnostics, auto-completion, and hover documentation. It will be automatically installed when you first open a .lumos file - just click "Install Now" when prompted!
Manual Installation (Optional):
cargo install lumos-lspFor code generation features (LUMOS: Generate Code command), install the CLI:
cargo install lumos-cliOr build from source:
git clone https://github.com/getlumos/lumos cd lumos cargo install --path packages/cli- 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, } LUMOS provides guaranteed type-safe mapping between Rust and TypeScript with full Borsh serialization compatibility:
| LUMOS Type | Rust Output | TypeScript Output | Notes |
|---|---|---|---|
u8, u16, u32 | u8, u16, u32 | number | Safe for all values |
u64, i64 | u64, i64 | number | |
u128, i128 | u128, i128 | bigint | Full precision |
bool | bool | boolean | |
String | String | string | UTF-8 encoded |
PublicKey | Pubkey | PublicKey | Solana 32-byte address |
Signature | Signature | Signature | 64-byte Ed25519 signature |
[T] | Vec<T> | T[] | Dynamic-length array |
Option<T> | Option<T> | T | undefined | Nullable type |
Key Benefits:
- Borsh Compatibility: Data serialized in Rust deserializes perfectly in TypeScript (and vice versa)
- Precision Warnings: Auto-generated JSDoc comments warn about JavaScript
numberprecision limits foru64/i64fields - Type Safety: Compile-time guarantees that your schemas match across languages
Example with Precision Warning:
// Generated TypeScript (automatic JSDoc warning) export interface UserAccount { wallet: PublicKey; /** WARNING: number in JS has precision limit of 2^53-1 (9007199254740991). * Values exceeding this will lose precision. For Solana lamports or large * values, consider validation. Original Rust type: u64 */ balance: number; items: PublicKey[]; }Learn More:
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:
Language Server:
lumos.lsp.enable: Enable/disable Language Server Protocol integration (default:true)lumos.lsp.path: Custom path to lumos-lsp binary (default:"lumos-lsp")lumos.lsp.autoInstall: Automatically install lumos-lsp if not found (default:true)lumos.lsp.trace.server: Debug LSP communication -"off","messages", or"verbose"(default:"off")
Code Generation:
lumos.validation.enabled: Enable/disable LUMOS schema validation (default:true)lumos.codeGeneration.autoGenerate: Automatically generate Rust/TypeScript on save (default:false)
Formatting:
lumos.format.indentSize: Number of spaces for indentation -2or4(default:4)lumos.format.sortAttributes: Sort attributes alphabetically (default:true)lumos.format.alignFields: Align colons in struct fields (default:true)
- Syntax highlighting and code snippets
- Code generation commands
- Language Server Protocol server implementation (getlumos/lumos#45)
- LSP integration into VSCode extension (#1)
- Real-time diagnostics and auto-completion
- Hover documentation
- Bracket matching and smart editing features
- Type mapping reference documentation
- Go to definition
- Find references
- Rename symbol
Track progress: See ROADMAP.md for detailed timeline
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.
- LUMOS Core: https://github.com/getlumos/lumos
- Language Server: Published as
lumos-lspon crates.io (coming soon) - Documentation: https://lumos-lang.org
MIT OR Apache-2.0
Enjoy! π