Editor
VS Code / Cursor
Highlighting, snippets, and a Run command for .sapi files. Lives in the snapapi-language folder. Older .snaptest files still highlight.
What you get
- Highlighting for current and legacy keywords, HTTP method aliases,
${VAR}, JSON bodies, and//comments - Snippets for a suite skeleton, GET/POST tests, EXPECT variants, SAVE, AUTH, HEADER, and QUERY
- Keyword completions, plus test-name completions after
SETUP:/TEARDOWN:/SUITE-SETUP:/SUITE-TEARDOWN:/DEPENDS: - Diagnostics on edit/save: unknown keywords, missing request paths, unknown SETUP/TEARDOWN/SUITE-SETUP/DEPENDS names (including cheap
IMPORTresolution),HEAD:paths, andREQUEST: OPTIONS /path.HELPER:is a procedure, not a test case. - SnapAPI: Run current file and Run test at cursor (the latter passes
snapapi --name)
Install from this repo
Clone deekshith-poojary98/snapapi, then copy the language pack into your editor:
cp -R snapapi-language ~/.vscode/extensions/deekshithpoojary.snapapi-language-0.1.0
Restart the editor. Cursor uses ~/.cursor/extensions/ instead. Open a .sapi file and highlighting should kick in.
VSIX
cd snapapi-language
npx @vscode/vsce package
code --install-extension snapapi-language-0.1.0.vsix
Install the CLI separately (pip install pysnapapi, or pip install -e . from the repo). GUI editors often drop the venv from PATH — set snapapi.cliPath or keep a .venv in the workspace.
Contributor debug
- Open the
snapapi-languagefolder in VS Code or Cursor. - Press F5 to launch an Extension Development Host.
- Open a
.sapifile.
If the workspace is the SnapAPI repo root, set the launch argument to --extensionDevelopmentPath=${workspaceFolder}/snapapi-language.
Settings
| Setting | Default | Meaning |
|---|---|---|
snapapi.cliPath | snapapi | CLI executable. ${workspaceFolder} is expanded. Default snapapi also looks in .venv/bin (GUI editors often omit the venv from PATH). |
snapapi.envFile | empty | Optional --env file for interpolation. |
snapapi.profile | empty | Optional --profile name. |
{
"snapapi.cliPath": "${workspaceFolder}/.venv/bin/snapapi",
"snapapi.envFile": "${workspaceFolder}/.env"
}
Run current file
With a .sapi file focused, SnapAPI: Run current file saves it and runs snapapi <file>. Env next to the suite loads automatically unless you set snapapi.envFile. Run test at cursor uses the nearest TEST: and passes --name. Output goes to the SnapAPI channel; the status bar shows the last result.