AURA for VS Code

AURA

Syntax highlighting, formatter, code completion, and live preview for .aura files (see docs/aura.md). Plain JavaScript, with no npm dependencies and no build step.

Inline scripts

Events may contain a script block: onTap: { state.count += 1; }. JavaScript is the default. scriptLanguage: "lua" at the start of the file selects Lua. The formatter leaves script contents unchanged; the preview executes the same handlers as the application. state contains the properties of the corresponding root; event.value contains a widget event's value. Use emit("name", value) to trigger declared signals.

Features

Installation

bash
tools/aura-vscode/scripts/install.sh

Packages the extension as a VSIX (without vsce) and installs it with code --install-extension. Then run “Developer: Reload Window” in VS Code.

Format on save (settings.json):

json
"[aura]": {
    "editor.defaultFormatter": "hertz.aura-language",
    "editor.formatOnSave": true
}

Development

Tests and generate.js currently use external application fixtures. Set AURA_APP=<fixture-root> to a tree containing app/ui and app/ui/aura-elements.json; otherwise the parent of the AURA checkout is searched. Some tests expect specific files and anchors: an arbitrary UI tree is insufficient, and custom fixtures need matching test cases. AURAC=<compiler> overrides the compiler path.

Documentation source: tools/aura-vscode/README.md · Download Markdown

Search for topics, widgets or APIs.