TEST-OK STUDIO: TDL Language Support
PREVIEW RELEASE: This extension is currently in active development and is released as a preview. Features may change, and we welcome your feedback.
TEST-OK STUDIO provides language support for the Test Description Language (TDL) integrated directly into Visual Studio Code. This extension is designed to enhance the test development workflow by offering advanced development and debugging capabilities for the TEST-OK validation ecosystem.
Overview
This extension transforms VS Code into a fully-featured development environment for TDL, supporting the creation of complex test sequences. It implements the Language Server Protocol (LSP) to provide robust code intelligence and immediate feedback while you type.
Features
This extension provides a rich editing experience for TDL files:
1. Code Completion
- Keywords: Suggestions for all TDL commands
VAR, FUNC, LIMIT, etc.
- Variables: Autocomplete for locally defined variables, global variables, and function parameters.
- Functions & Commands: intelligent suggestions for built-in functions and commands.
- Built-in Variables: complete list of system variables (e.g.,
#_HEX_FILE_) with type and description.
- Maps: Suggestions for defined map names.

2. Diagnostics
- Syntax Checking: Real-time validation of TDL syntax using a generated parser.
- Redefinition Detection: Errors when variables, maps, or functions are redefined in the same scope.
- Undefined References: Warnings/Errors for usage of undefined variables or maps.
- Branch Consistency: Ensures
VAR GLOBAL and CONFIG_LIMITS are consistently defined across IF/ELIF/ELSE branches, or that ELSE contains a FAIL statement.

- Variables: Hover over any variable to see its kind (Variable, Global, Parameter), inferred type (
Integer, Double, String, Hex, Binary, Boolean, OnOffVal), and initialization value.
- Built-in Variables: Detailed type information and descriptions for all system variables.
- Functions: Documentation and signatures for built-in functions (e.g.,
min, max) and user-defined functions.
- Commands: Detailed documentation, signatures, and parameter descriptions for TDL commands (e.g.,
SET_SUPPLY, TEST_ANALOG).
4. Code Folding
- Foldable blocks: Collapse/expand
FUNC_DEF/ENDFUNC, IF/ENDIF, FOR/ENDFOR, WHILE/ENDWHILE, and CALIBRATE/END blocks.
- Comment folding: Consecutive comment lines (
//) can be folded as a group.
5. Navigation
- Workspace Symbols: Use
Ctrl+T (or Cmd+T) to search for symbols (variables, functions, maps) across the entire workspace.
- Go to Definition: Right-click or
Ctrl+Click (or Cmd+Click) on a variable usage to jump to its definition.
- Smart Indentation: Automatically indents code blocks (
FUNC, IF, FOR, WHILE) and correctly dedents closing keywords (END*, ELSE).
7. Log File Support
- Syntax Highlighting: TTlog files (
TTlog.txt, TTlog_normal.txt, TTlog_debug.txt) are automatically highlighted with distinct colors for log levels, timestamps, commands, and verdicts.
- Output Streaming: Log file changes are streamed to a dedicated Output Channel ("TDL Test Log") with native VS Code log level filtering via the "Developer: Set Log Level..." command. Timestamps are converted from relative milliseconds to actual times.
- Ctrl+Click Navigation: Click on file paths (
*** Z:\path\to\file.tdl) or line numbers ((123)) in log files to jump directly to the source code location. Correctly handles function call context - lines inside FUNC_CALL/END_FUNC blocks link to the function's definition file.
- Outline/Breadcrumb: Navigate large log files using VS Code's Outline panel. Hierarchy: Functions (init) → Tests → Files → Function calls → FOR/WHILE loops. Loop scope inferred from source line numbers.
- Timing Decorations: Colored dots in TDL source file gutters showing execution performance (green=fast, yellow=medium, red=slow). Toggle with "TDL: Toggle Timing Decorations".
- Flamegraph: Interactive execution visualization. Open with "TDL: Show Flamegraph". Click on blocks to navigate to source.
- Commands:
- "TDL: Show Log Output" - Open log output panel
- "TDL: Toggle Timing Decorations" - Toggle gutter timing dots
- "TDL: Show Flamegraph" - Open flamegraph visualization
- Right-click → "Show Line Timing" - View detailed timing for current line

8. Command-Line Validation (tdl-check)
The extension includes tdl-check, a command-line tool that runs the same checks as the editor without opening VS Code. Use it to check a whole project at once, validate generated scripts, or add TDL checks to a CI pipeline. It needs Node.js and is located in the installed extension folder (for example ~/.vscode/extensions/test-ok.test-ok-studio-<version>/server/out/cli.js):
node <extension folder>/server/out/cli.js path/to/project # human-readable problem list
node <extension folder>/server/out/cli.js path/to/project --format json # machine-readable output
- Pass a folder to check every
.tdl file in it, or a single .tdl file to check just that file (its project is loaded so functions, globals and limits from other files are recognized).
- Every problem has a rule code (for example
undefined-variable, unused-symbol, rename-var) so output can be filtered.
--min-severity, --fail-on and --config <settings.json> control what is reported and what fails. Run with --help for all options.
- Exit code
0 means no problems at or above the --fail-on level (by default: no errors; warnings do not fail), 1 means such problems were found, 2 means invalid usage.
Support & Feedback
We value your input in making this tool better.
- Report Bugs & Feature Requests: Please email us at info@test-ok.nl
- Discussion: Feel free to reach out with any questions or suggestions.
| |