Skip to content
Documentation

VS Code extension

VS Code with a Luca Code file open: syntax highlighting, the Run action in the editor title bar, and program output in the integrated terminal
One-key run from the editor title bar; output lands in the integrated terminal. Real screenshot from the repository.

The official extension gives .lucc files syntax highlighting, snippets, one-key run, and syntax/import validation. It is published on the Marketplace by luca-ecosystem, and this page mirrors what you see on its Marketplace listing. Luca Code is a small general-purpose language with exact decimal math (10 / 4 is 2.5), plain-language errors, and a dependency-free Rust reference interpreter — this extension is the editor front end: write a .lucc file, press Run, and see output in the integrated terminal or diagnostics in the editor.

1. Install the extension

  1. Install the luca CLI first: install, then check luca --version works in a terminal.
  2. In VS Code: Extensions view (⇧⌘X) → search "Luca Code" → click Install, or install directly from the Marketplace listing.
  3. Open any .lucc file — keywords should be highlighted.

Requirements: the extension drives the luca CLI, so install it first (a Rust-based build; no account needed). On macOS or Linux:

bash <(curl -fsSL https://raw.githubusercontent.com/LucaEcosystem/luca-code/main/scripts/install.sh)
luca --version                     # prints: luca 1.0.4 Beta

On Windows, use git clone --depth 1 https://github.com/LucaEcosystem/luca-code.git, then .\scripts\install.ps1 in PowerShell. Full per-OS instructions and PATH fixes: install guide.

2. Use it

  • Luca: New Luca File (⇧⌘P → type "Luca") opens a starter program.
  • Luca: Run Luca File (same menu, or the run button in the editor title bar when a .lucc file is open) saves and runs the file. By default it runs in the integrated terminal (a shared "Luca" terminal), so output appears where you already look — and programs using ask can read your typing. Set luca.runInTerminal to off to run in the Output panel on the Luca Code channel instead, which turns Error at line:column: and Warning at line:column: output into clickable squiggles in the editor.
  • Luca: Check Luca File (same menu, or the check button in the editor title bar) saves the file and runs luca check --format json. Syntax errors and missing or circular imports appear as squiggles without executing the program. It never evaluates expressions or touches the filesystem, so type mismatches on computed values, bad runtime arity, division by zero, and ask conversion errors still surface only when you run.
  • Diagnostics — error and warning lines from run or check map to inline editor markers, with the first error popping up at its location.
  • Snippets — type try, error, raise, func, if, for, while, ask, import, or print and press Tab.
  • Syntax highlighting for .lucc files — keywords, strings, interpolation, comments, numbers.

Settings

SettingDefaultWhat it does
luca.cliPathluca (from PATH)Absolute path to the luca binary when it is not on your PATH
luca.runInTerminaltrueRun in the integrated terminal; when off, run in the Output > Luca Code channel with clickable diagnostics

What the extension does not do

  • Check is syntax + import validation only. luca check does not statically type-check expressions, so errors such as assigning a str to an int variable surface only when you run.
  • The CLI must be installed. The extension is a front end for the luca binary; it does not bundle an interpreter.
  • No language server. Highlighting is TextMate-based, and diagnostics come from running or checking the file, not from live incremental analysis.
  • Source nesting is capped at 32 levels and function recursion at 64 frames. Deeper code reports a normal diagnostic rather than crashing; see known limitations.

3. If the extension cannot find Luca

You will see: "the 'luca' CLI was not found." Fix it one of two ways:

  • Put luca on your PATH (the installer does this; see troubleshooting), restart VS Code, and run again, or
  • Set the luca.cliPath setting to the absolute path of the binary (Settings → search "Luca Code", or run Preferences: Open User Settings (JSON) and add "luca.cliPath": "/Users/you/.cargo/bin/luca").

4. Upgrade / uninstall

  • Upgrade the extension: VS Code updates Marketplace extensions automatically, or reinstall from the Marketplace listing to force the newest version. (Packaged by hand? The extension source lives in editors/vscode/ in the repository; current extension version is 1.0.4.)
  • Upgrade the CLI: re-run the installer (install §3).
  • Uninstall the extension: Extensions view → Luca Code → Uninstall. Uninstall the CLI: install §4.

Next steps

Learning the language: the guided tour (twelve short chapters with runnable snippets and their real output). Otherwise, back to the first program. The language reference and standard library reference hold the complete rule set.