Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Lux (LUcid eXpect scripting) Language SupportNew to Visual Studio Code? Get it now.
Lux (LUcid eXpect scripting) Language Support

Lux (LUcid eXpect scripting) Language Support

duyn

|
19 installs
| (0) | Free
Lux test language support extension
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

lux-vscode

Language support for Lux (LUcid eXpect scripting) in VS Code.

https://marketplace.visualstudio.com/items?itemName=duyn.lux-vscode

Features

  • Lux syntax highlighting
  • Go to definition
  • Run order preview for cached Lux files
  • Variable values on hover in Lux root files
  • Macro content on hover over an [invoke] name
  • Source lines for a Lux failure location
  • A read-only execution trace of Lux source and shell output

Execution trace

Run Lux: Show Execution Trace and enter a Lux test file, test folder, or local log folder. The default is lux_logs/latest_run beside the active file. Clear the input to show the focused Lux file with expanded invokes and no log output. A relative path starts from the active file's folder or the workspace folder. For external log folders, the command uses the source path in the event HTML to find the Lux file in the current workspace and checks it against the logged source snapshot. Lux source files must be in an open workspace folder. If a folder has logs for several tests, you can select the test. One read-only tab shows the execution trace. Each [invoke] section starts collapsed and gains a tinted header and outline when expanded. Each nesting level has its own color. Neighboring sections alternate between dim and bright shades of that color. Headers of open sections stay visible while scrolling, with nested headers stacked below their parents. Click a sticky header to scroll to its section. Dynamic invokes show each possible macro in a separate collapsed section. Recorded commands identify which candidate receives shell output when the match is unambiguous. Open a section to see its expansion, or use the buttons to collapse or expand all sections. Press Ctrl+G or run Lux: Go to Line in Execution Trace to jump to a main Lux source line. Right-click a line and choose Go to Definition, or press F12 on a focused line, to open its source file.

The view shows captured output when an assertion reads it. A failed triple-quoted assertion shows a side-by-side comparison of the Lux block and captured log lines. After a failure, unexecuted Lux lines and invoke expansions appear in grey without further execution output. Cleanup runs in normal colors until it fails. Each matching assertion appears where its match ends in the output. Output after the last assertion is hidden until another assertion in that shell reads it. Commands without a later assertion show no output, including when the source switches to another shell. A variable shell name resolves to its known value. When a loop gives the shell variable several known values, the view lists those shells and puts each shell's assertion and output in its own collapsed section. Hover over a variable to see its known value. Hover over a line to highlight it. Hold Cmd on macOS or Ctrl on Windows and Linux, then click to open that line's source. When cache and run order are enabled, the view expands [invoke] calls and includes that execute both a command and an assertion. Each expansion adds two spaces of indentation, and repeated calls show their own results. The view keeps named invoke arguments such as loop=2 and labels positional arguments with a small, underlined parameter name such as cmd:"load merge file.xml". The colon is not underlined. Lines expanded from an invoke keep Lux syntax coloring and tint only their line numbers. Captured output has a grey background and a border around each block, both inside and outside invokes. The main Lux file's other lines remain visible, except for macro definitions. Variable assignments and their continued lines remain visible. Blank lines beside omitted macro definitions are trimmed. Executed macro lines appear at invoke sites. Shown output lines have the same indentation as the assertion. Output comes from the matching shell's .stdin.log and .stdout.log files. Go to Definition (F12) opens the original Lux line for source rows and the corresponding stdout log line for output rows.

Output blocks start with the stdout log path and line range, followed by the echoed command and its captured output. Paths in the workspace are relative to the Lux file's folder. Paths outside the workspace are absolute. Blocks with multiple output lines start collapsed, except blocks tied to a failure. Click the path line to collapse or reopen the block. A collapsed block keeps the log path and line range visible. The path and output use the following assertion's indentation. Collapse sections and Expand sections also affect output blocks. Expand visible log opens only output blocks that are visible, including those inside open invoke sections. A one-line output block has no toggle.

A green check or red cross beside each assertion shows whether it matches the captured output in order. Only the matched output text turns green. This also works for multiline blocks opened with """?, """??, or """???. Their captured output appears before the opening line, and the marker appears on that line. ? uses a regular expression. ?? checks literal text after variable substitution. ??? checks literal text without variable substitution. Assertions with unknown variables or unsupported regular expressions have no marker.

When a failed block comparison reaches an edge, scrolling in that direction continues in the main trace after 0.1 seconds. Scrolling sideways does not reset the vertical edge timer.

Run order analysis

Run order analysis works automatically in the background for the execution trace, variable hover, and Go to Definition when lux.cache.enabled is on. Caching is enabled by default.

An assignment with ?= sets a default only when its scope has no earlier value.

Hover over a $variable in a .lux or .lux.tmpl root file to see its value from the run order. The hover shows the latest assignment's file and line above the value. If different paths have different latest assignments, it lists those locations. If a line can run with different values, the hover lists them. When caching is disabled, variable hover shows built-in and configured values, and Go to Definition uses text search.

With lux.cache.enabled enabled, hover over a macro name in [invoke name] to see its complete [macro] to [endmacro] block. The hover uses the same definition search as F12, then reads the block from the cache when available. If the cached block is missing or older than an open document, it reads the source file. It works in Lux source files. If the search finds several matching macros, the hover shows each one with its source file and line. Disabling the cache also disables macro hover.

Macro and variable hover headers show paths relative to the current source file's directory when the definition is in that directory or a subdirectory. Other workspace files use paths relative to the workspace folder. Other files keep their full paths.

Failure locations

A root file is the .lux or .lux.tmpl file for the test. A failure location contains source line numbers and loop counts separated by colons. It can also start with a Lux file name. Run Lux: Show Failure Location from the Command Palette.

Enter path/a/b/test.lux:576:53:732:727 to find the file under a workspace folder. Enter test.lux:576:53:732:727 to search by file name. If the active root file has that name, the command uses it first. If a root file is active, you can enter only 576:53:732:727.

The command opens a temporary result editor. The trace lists source locations in order. A source entry shows its file, line number, source lines, and Lux syntax colors. Use Go to Definition (F12) on a file heading or source line to open the original file. If several files have the same name, select the correct file from the list.

A macro is a named block of Lux commands. If Lux selects a macro at run time, the command removes matches on comments and block boundaries. It then uses the next trace line and the literal macro arguments on the [invoke] line. If several paths remain, the file list explains the choice. It shows each macro name, line range, and source line.

A negative number shows how many times a loop ran. For example, 368:-2:369 shows -2 as looped 2 times. That entry has no source lines.

If one index points to a [loop] line and the next points inside that loop, the trace marks the first entry skipped loop header. That entry shows the file and line without source lines. The next entry shows the loop in its source context.

A cache stores data from files that the extension read before. If the cache is enabled and its data matches the source files, the command uses its include and macro locations. Otherwise, the command reads the source files.

The Lux Language Support output channel records trace generation, missing files, rejected paths, and unresolved lines. It also gives the reason for each rejected path. To read these messages, run View: Toggle Output and select Lux Language Support.

By default, lux.failureTrace.showFullMacroBlock is true. If a location is inside a macro, the trace shows the full [macro] to [endmacro] block. Set it to false to show only nearby lines. For locations outside macros, the trace always shows nearby lines.

Configuration

Use lux.envVariables to set environment variables that contain paths. For example:

"lux.envVariables": {
    "TEST_LIB_DIR_1": "~/repo/test/system/test"
    "TEST_LIB_DIR_2": "$WORKSPACE$/system/test"
  },

A path can be relative or absolute. You can use $WORKSPACE$ in a path. The extension replaces it with the current workspace path.

Known issue

The extension cannot find the destination when an [invoke] name contains multiple variables, such as [invoke $a-$b 1].

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft