Files
lux/editors/vscode
Brandon Lucas a6eb349d59 feat: improve editor tooling and fix warnings
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>
2026-02-13 18:23:55 -05:00
..

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

  1. Clone the repository
  2. Navigate to editors/vscode
  3. Run npm install
  4. Run npm run compile
  5. 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 lux is in your PATH, or configure lux.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

  1. Check lux.lspPath is correct
  2. Ensure lux binary is executable
  3. Run Lux: Restart Language Server
  4. Check Output panel for errors

No syntax highlighting

  1. Ensure file has .lux extension
  2. Try reloading VS Code

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes
  4. Submit a pull request

License

MIT License - see the main Lux repository for details.