A thin LSP client that spawns `testium lsp` and forwards messages to
VSCode. All language intelligence lives in the testium repo, so this
extension only needs republishing for editor-side UX changes.
- package.json: declares the .tum language, registers the LSP client,
exposes testium.serverPath and testium.trace.server settings.
- src/extension.ts: vscode-languageclient setup over stdio, surfaces a
user-visible error if `testium lsp` can't start.
- syntaxes/tum.tmLanguage.json: TextMate grammar embedding source.yaml
plus tum-specific tokens for $(name), <| python |>, {% jinja %},
{{ jinja }}.
- language-configuration.json: comment char, bracket pairs, auto-close
for $(/), <|/|>, {%/%}, {{/}}.
- README.md: install (incl. testium[lsp] extra), settings, packaging
via vsce, publish to both VS Marketplace and Open VSX (the latter
is what VSCodium / Cursor / Gitpod use — same .vsix artifact).
Works identically on VSCode and VSCodium — no Microsoft-proprietary
API surface used.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
96 lines
3.0 KiB
Markdown
96 lines
3.0 KiB
Markdown
# Testium Assist
|
|
|
|
Language support for [testium](https://git.beafrancois.fr/v-and-v/testium) `.tum`
|
|
test scripts: syntax highlighting, completion, hover, and (later)
|
|
diagnostics.
|
|
|
|
Works the same on **VSCode** and **VSCodium** — the extension uses
|
|
only the standard VSCode API and `vscode-languageclient`, no
|
|
Microsoft-proprietary surface.
|
|
|
|
## How it works
|
|
|
|
The extension is a thin LSP client that spawns the language server
|
|
shipped with testium itself (`testium lsp`). All the language
|
|
intelligence (item types, parameter completion, schema awareness)
|
|
lives in the testium repo — every new item type or parameter you add
|
|
upstream becomes available in the editor on the next testium upgrade,
|
|
without re-publishing this extension.
|
|
|
|
Two static parts live here, because they need to run *before* the LSP
|
|
has a chance to start:
|
|
|
|
- **Syntax highlighting** — a TextMate grammar under `syntaxes/`
|
|
delegates to the base YAML grammar and adds tokens for testium's
|
|
`$(name)`, `<| python expr |>`, and Jinja `{% … %}` / `{{ … }}`
|
|
constructs.
|
|
- **Editor configuration** — comment character, bracket pairs,
|
|
auto-close pairs for `$( )`, `<| |>`, `{% %}`, `{{ }}`.
|
|
|
|
## Requirements
|
|
|
|
- VSCode ≥ 1.80 (or any recent VSCodium build).
|
|
- A working `testium` installation with the `lsp` extra:
|
|
```sh
|
|
pip install 'testium[lsp]'
|
|
```
|
|
Or, when developing testium from source:
|
|
```sh
|
|
pip install -e /path/to/testium/src[lsp]
|
|
```
|
|
|
|
## Settings
|
|
|
|
| Setting | Default | Description |
|
|
|---|---|---|
|
|
| `testium.serverPath` | `testium` | Path to the `testium` executable. Set this to your venv's `bin/testium` if `testium` isn't on `$PATH`. |
|
|
| `testium.trace.server` | `off` | LSP trace level surfaced in the **Testium LSP** output channel. |
|
|
|
|
## Development
|
|
|
|
```sh
|
|
npm install
|
|
npm run compile # one-shot build
|
|
npm run watch # rebuild on save
|
|
```
|
|
|
|
Press **F5** in VSCode to launch a development host with the extension
|
|
loaded. Open any `.tum` file; the **Testium LSP** output channel shows
|
|
the language-server traffic when `testium.trace.server` is set to
|
|
`messages` or `verbose`.
|
|
|
|
## Packaging
|
|
|
|
```sh
|
|
npx vsce package # produces testium-assist-<v>.vsix
|
|
```
|
|
|
|
To install locally without publishing:
|
|
- **Code/Codium UI** — `Extensions: Install from VSIX…` from the
|
|
command palette, pick the `.vsix`.
|
|
- **CLI** — `code --install-extension testium-assist-<v>.vsix` (or
|
|
`codium --install-extension …`).
|
|
|
|
## Publishing
|
|
|
|
The extension targets two registries:
|
|
|
|
- **VS Marketplace** (used by VSCode) — `npx vsce publish`. Requires a
|
|
Microsoft publisher account.
|
|
- **Open VSX** (used by VSCodium, Cursor, Gitpod, Theia, Eclipse Che) —
|
|
`npx ovsx publish`. Free and open.
|
|
|
|
Both consume the same `.vsix` artifact. A GitHub Actions workflow that
|
|
runs both on tag push is the typical setup.
|
|
|
|
## Status
|
|
|
|
This is the MVP: completion of test item type names at the start of a
|
|
new step. Hover, parameter completion, outline and diagnostics will
|
|
follow as the testium LSP server gains those features — no extension
|
|
re-publish needed.
|
|
|
|
## License
|
|
|
|
EUPL-1.2 — same as testium.
|