Neovim improvements: - Add tree-sitter text objects for functions, types, blocks - Add folding support - Enhanced REPL integration (toggle, send line/selection) - New commands: LuxCheck, LuxReplToggle, LuxSend - Better keybindings with localleader VS Code extension: - Full syntax highlighting with TextMate grammar - LSP client integration - 20+ snippets for common patterns - Commands: run, format, check, REPL - Keybindings and context menu Fixes: - Fix all cargo warnings with #[allow(dead_code)] annotations - Clean up unused variables Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Lux Language Extension for VS Code
Visual Studio Code extension for the Lux programming language.
Features
- Syntax Highlighting: Full syntax highlighting for Lux files
- LSP Integration: Real-time diagnostics, hover info, completions, go-to-definition
- Snippets: Common code patterns (functions, types, effects, handlers)
- REPL Integration: Start REPL and send code to it
- Commands: Run, format, type-check files
Installation
From VS Code Marketplace
Search for "Lux Language" in the VS Code extensions panel.
From Source
- Clone the repository
- Navigate to
editors/vscode - Run
npm install - Run
npm run compile - Press F5 to launch a development VS Code window
Manual VSIX Install
cd editors/vscode
npm install
npm run compile
npx vsce package
code --install-extension lux-lang-0.1.0.vsix
Requirements
- Lux binary: Install Lux and ensure
luxis in your PATH, or configurelux.lspPath - Node.js: For development
Configuration
| Setting | Default | Description |
|---|---|---|
lux.lspPath |
"" |
Path to Lux binary. Empty = search PATH |
lux.lsp.enabled |
true |
Enable the language server |
lux.format.onSave |
false |
Format files on save |
lux.diagnostics.enabled |
true |
Show inline diagnostics |
Commands
| Command | Keybinding | Description |
|---|---|---|
Lux: Run Current File |
Ctrl+Shift+R |
Run the active file |
Lux: Format Document |
- | Format the active file |
Lux: Type Check File |
- | Type check without running |
Lux: Start REPL |
- | Open Lux REPL in terminal |
Lux: Send Selection to REPL |
Ctrl+Enter |
Send selected code to REPL |
Lux: Restart Language Server |
- | Restart the LSP |
Snippets
| Prefix | Description |
|---|---|
fn |
Function definition |
fne |
Function with effects |
type |
Type definition |
effect |
Effect definition |
handler |
Effect handler |
match |
Match expression |
if |
If expression |
let |
Let binding |
run |
Run with handlers |
trait |
Trait definition |
impl |
Impl block |
matchopt |
Match on Option |
matchres |
Match on Result |
print |
Console.print |
main |
Main function template |
Language Features
Syntax Highlighting
- Keywords (
fn,let,type,effect,handler,match, etc.) - Built-in types (
Int,Float,Bool,String,Option,Result) - Operators (
=>,|>,==, etc.) - String interpolation
- Comments (line
//and doc///)
LSP Features
The Lux language server provides:
- Diagnostics: Real-time error and warning display
- Hover: Type information on hover
- Completions: Context-aware suggestions
- Go to Definition: Navigate to definitions
Code Folding
Fold:
- Function bodies
- Type definitions
- Effect declarations
- Handler blocks
- Match expressions
Development
# Install dependencies
npm install
# Compile
npm run compile
# Watch mode
npm run watch
# Lint
npm run lint
# Package
npx vsce package
Troubleshooting
LSP not starting
- Check
lux.lspPathis correct - Ensure
luxbinary is executable - Run
Lux: Restart Language Server - Check Output panel for errors
No syntax highlighting
- Ensure file has
.luxextension - Try reloading VS Code
Contributing
- Fork the repository
- Create a feature branch
- Make changes
- Submit a pull request
License
MIT License - see the main Lux repository for details.