Skip to content

Visual Studio Code

The official LUMOS extension for Visual Studio Code provides a complete development experience for .lumos schema files.

  1. Open VS Code
  2. Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS)
  3. Search for “LUMOS”
  4. Click Install

Or install from the command line:

Terminal window
code --install-extension getlumos.lumos

Marketplace Link: LUMOS - Visual Studio Marketplace

For offline installation or specific versions:

Terminal window
# Download latest .vsix from GitHub releases
curl -LO https://github.com/getlumos/vscode-lumos/releases/latest/download/lumos.vsix
# Install in VS Code
code --install-extension lumos.vsix

Full syntax highlighting for .lumos files:

  • Keywords: struct, enum, type, mod, use, pub, import, from
  • Types: u8-u128, i8-i128, bool, String, PublicKey, Signature
  • Attributes: #[solana], #[account], #[deprecated]
  • Comments: Line (//) and block (/* */)

Smart code completion for:

  • Type names (primitives, Solana types, user-defined)
  • Attribute suggestions
  • Field type completion
  • Enum variant suggestions

Instant error detection as you type:

Error: Undefined type 'InvalidType'
--> schema.lumos:5:12
|
5 | field: InvalidType,
| ^^^^^^^^^^^ type not defined

Automatic suggestions to fix common issues:

  • Missing semicolons
  • Undefined type references
  • Invalid attribute combinations

Built-in snippets for common patterns:

PrefixDescription
structSolana account struct
enumSolana enum definition
accAccount struct with common fields
typeType alias
deprecatedDeprecated field attribute

Example usage: Type struct and press Tab:

#[solana]
#[account]
struct ${1:Name} {
${2:field}: ${3:Type},
}

Auto-format .lumos files on save (if enabled in VS Code settings).

Access LUMOS commands via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

CommandDescription
LUMOS: Generate CodeGenerate Rust/TypeScript from current file
LUMOS: Validate SchemaValidate current schema
LUMOS: Show VersionDisplay installed LUMOS version

Configure the extension in VS Code settings (settings.json):

{
// Path to lumos CLI (auto-detected if on PATH)
"lumos.cliPath": "lumos",
// Enable real-time diagnostics
"lumos.diagnostics.enable": true,
// Enable format on save for .lumos files
"lumos.format.onSave": true,
// Default output directory for generation
"lumos.generate.outputDir": "./generated",
// Target languages for generation
"lumos.generate.languages": ["rust", "typescript"],
// Show inline hints for type sizes
"lumos.inlayHints.showSizes": false
}

The extension automatically associates .lumos files. To add additional patterns:

{
"files.associations": {
"*.lumos": "lumos",
"*.schema": "lumos"
}
}

  • VS Code 1.75.0 or higher
  • LUMOS CLI - For code generation commands

    Terminal window
    cargo install lumos-cli
    # or
    npm install -g @getlumos/cli
  • LSP Server - For advanced IntelliSense (automatically bundled)


  1. Check file extension is .lumos
  2. Reload VS Code window (Ctrl+Shift+P → “Developer: Reload Window”)
  3. Check Output panel for errors (ViewOutput → select “LUMOS”)
  1. Verify lumos.diagnostics.enable is true
  2. Check LUMOS CLI is installed and on PATH:
    Terminal window
    lumos --version
  3. Check LSP server is running (see Output panel)
  1. Ensure LUMOS CLI is installed
  2. Check schema has valid syntax first:
    Terminal window
    lumos validate schema.lumos
  3. Verify output directory exists and is writable
  1. Wait for LSP server to initialize (check status bar)
  2. Try restarting the LSP: Ctrl+Shift+P → “LUMOS: Restart Language Server”
  3. Check for conflicting extensions

ShortcutAction
Ctrl+Shift+BGenerate code from current file
F5Validate current schema
Ctrl+SpaceTrigger IntelliSense

Add to keybindings.json:

[
{
"key": "ctrl+alt+g",
"command": "lumos.generateCode",
"when": "editorLangId == lumos"
}
]

The extension works in multi-root workspaces. Each workspace folder can have its own LUMOS configuration.



See the extension changelog for version history.