Skip to content

Using LUMOS with IntelliJ IDEA

Use LUMOS in IntelliJ IDEA, Rust Rover, and CLion with full language support including syntax highlighting, auto-completion, and real-time diagnostics.

  • File Type Recognition - .lumos files automatically recognized
  • LSP Integration - Full language server protocol support
  • Auto-Completion - Smart suggestions for types and attributes
  • Real-Time Diagnostics - Instant error detection
  • Hover Documentation - Inline type information
  • Multi-IDE Support - Works with IntelliJ IDEA, Rust Rover, and CLion

The plugin requires the LUMOS Language Server (lumos-lsp) to provide IDE features.

Terminal window
# Install via Cargo
cargo install lumos-lsp
# Verify installation
lumos-lsp --version
# Output: lumos-lsp 0.1.1
  • IntelliJ IDEA Community - 2024.1 or higher
  • IntelliJ IDEA Ultimate - 2024.1 or higher
  • Rust Rover - 2024.1 or higher
  • CLion - 2024.1 or higher

Check your IDE version: Help → About


Option 1: From JetBrains Marketplace (Coming Soon)

Section titled “Option 1: From JetBrains Marketplace (Coming Soon)”
1. Open: Settings → Plugins (Cmd+, → Plugins)
2. Search: "LUMOS" in Marketplace tab
3. Click: Install
4. Restart IDE
  1. Download the latest release:

  2. Install from disk:

    Settings → Plugins → ⚙️ (Settings icon) → Install Plugin from Disk
    Select: intellij-lumos-X.X.X.zip
    Click: OK → Restart IDE

player.lumos
#[solana]
#[account]
struct Player {
wallet: PublicKey,
score: u64,
level: u16,
}
  • Syntax highlighting - Keywords, types, attributes color-coded
  • Auto-completion - Type Pub → suggests PublicKey
  • Error detection - Invalid syntax shows red squiggles
  • Hover info - Hover over types to see documentation

Open terminal in IDE:

Terminal window
lumos generate player.lumos
# Output:
# ✓ Generated player.rs
# ✓ Generated player.ts

Keywords, types, and attributes are automatically highlighted:

  • Keywords: struct, enum, pub
  • Attributes: #[solana], #[account], #[version]
  • Types: PublicKey, u64, Vec, Option
  • Comments: // and /* */

Press Ctrl+Space for intelligent suggestions:

Solana Types:

  • PublicKey - Solana public key (32 bytes)
  • Signature - Transaction signature

Primitive Types:

  • u8, u16, u32, u64, u128
  • i8, i16, i32, i64, i128
  • bool, String

Complex Types:

  • Vec<T> - Dynamic array
  • Option<T> - Optional value

Attributes:

  • #[solana] - Mark as Solana-specific
  • #[account] - Anchor account marker
  • #[version(N)] - Schema version

Errors appear instantly as you type:

Example - Undefined type:

struct Player {
item: UnknownType // ← Red squiggle: "Undefined type 'UnknownType'"
}

Example - Missing attribute:

struct Player { // ← Yellow warning: "Consider adding #[solana] attribute"
wallet: PublicKey,
}

Hover over any type or field to see inline documentation:

struct Player {
wallet: PublicKey // ← Hover shows: "Solana public key (32 bytes)"
// Used for account addresses
}

The plugin automatically detects lumos-lsp. If you need to specify a custom path:

1. Open: Settings → Languages & Frameworks → Language Servers
2. Find: LUMOS Language Server
3. Set custom path: /path/to/lumos-lsp
4. Click: OK
Settings → Languages & Frameworks → Language Servers
→ LUMOS Language Server → Enable/Disable

Symptom: No auto-completion or diagnostics appear

Diagnosis:

Terminal window
# Check if lumos-lsp is installed
which lumos-lsp
# If not found, install it
cargo install lumos-lsp
# Verify version
lumos-lsp --version

Fix:

  1. Ensure lumos-lsp is in PATH or ~/.cargo/bin/
  2. Restart IDE: File → Invalidate Caches → Invalidate and Restart
  3. Check IDE logs: Help → Show Log in Finder → Search for “lumos”

Symptom: Can’t find LUMOS in installed plugins

Fix:

  1. Verify IDE version is 2024.1 or higher: Help → About
  2. Install LSP4IJ dependency:
    Settings → Plugins → Marketplace → Search "LSP4IJ" → Install
  3. Reinstall LUMOS plugin
  4. Restart IDE

Symptom: .lumos files open as plain text

Fix:

  1. Right-click .lumos file
  2. Select: Associate with File Type
  3. Choose: LUMOS
  4. Restart IDE

Fix:

  1. Check color scheme: Settings → Editor → Color Scheme
  2. Verify plugin is enabled: Settings → Plugins → Installed → LUMOS (✓)
  3. Reload file: File → Reload All from Disk

ActionWindows/LinuxmacOS
Auto-completionCtrl+SpaceCmd+Space
Show documentationCtrl+QCtrl+J
Go to definitionCtrl+BCmd+B
Find usagesAlt+F7Opt+F7
Reformat codeCtrl+Alt+LCmd+Opt+L

token-vault.lumos
#[solana]
#[account]
struct TokenVault {
authority: PublicKey,
mint: PublicKey,
amount: u64,
created_at: i64,
}
#[solana]
enum VaultStatus {
Active,
Frozen,
Closed,
}

Open terminal in IDE (Alt+F12 / Opt+F12):

Terminal window
lumos generate token-vault.lumos
# Output:
# ✓ Generated token-vault.rs
# ✓ Generated token-vault.ts

Rust (Anchor program):

use crate::TokenVault;
#[program]
pub mod token_vault {
pub fn initialize(ctx: Context<Initialize>, amount: u64) -> Result<()> {
let vault = &mut ctx.accounts.vault;
vault.authority = ctx.accounts.authority.key();
vault.amount = amount;
Ok(())
}
}

TypeScript (Client):

import { TokenVault } from './token-vault';
const vault = await program.account.tokenVault.fetch(vaultPubkey);
console.log(`Vault amount: ${vault.amount}`);

Project Structure:

my-solana-project/
├── schemas/
│ └── vault.lumos
├── programs/
│ └── src/
│ └── lib.rs
└── client/
└── src/
└── index.ts

Run Configuration:

Run → Edit Configurations → + → Shell Script
Name: Generate LUMOS
Script: lumos generate schemas/vault.lumos
Working directory: $PROJECT_DIR$

Cargo Integration:

Cargo.toml
[build-dependencies]
# Add script to run lumos generate before build

Build Script:

Tools → External Tools → + → Add
Name: LUMOS Generate
Program: lumos
Arguments: generate $FilePath$
Working directory: $ProjectFileDir$

Similar to Rust Rover, use External Tools for LUMOS commands.



IDEVersionStatus
IntelliJ IDEA Community2024.1+✅ Fully Supported
IntelliJ IDEA Ultimate2024.1+✅ Fully Supported
Rust Rover2024.1+✅ Fully Supported
CLion2024.1+✅ Fully Supported


Questions or issues? Open an issue on GitHub