Language support for Tengo and Platforma Tengo
packages: syntax highlighting plus full IDE features powered by
tengo-lsp.
- Syntax highlighting for
.tengofiles (TextMate grammar). - Go to definition
- jump from an
import("...")string to the imported file; - jump from an import alias (
utilinutil := import(":util")) to the imported file; - jump from
alias.memberto the matching key in the target file'sexport { ... }block; - resolve SDK artifact calls —
plapi.getTemplateId,ll.importTemplate,assets.importSoftware,assets.importAsset,getSoftwareInfo— from their string argument to the artifact file.
- jump from an
- Find references — workspace-wide for exported module members: every
alias.memberusage in importing files plus references inside the defining module. Local symbols resolve within their scope in the current file. - Completion — type
.after an imported alias to list the members exported by that module. - Hover — shows the signature and doc comment (
//and/** */JSDoc blocks, resolved through wrappedexportmaps) of imported members. - Document outline — top-level imports, functions, and variables, with an
exportgroup whose children are each exported member; populates the Outline view and the breadcrumb bar.
Imports are resolved the way the Platforma package builder resolves them:
- Local artifacts (
:util,:pframes.pcolumn) resolve against the current package'ssrc/directory, with dotted ids mapping to nested paths andindex.*fallbacks. - Package artifacts (
@scope/pkg:index,pkg:util) resolve via the nearestnode_modules, probing both the source layout and the publisheddist/tengo/{lib,software,asset}/<id>.<ext>layout.
Stdlib modules (fmt, json, text, os, …) are recognized and do not
navigate to a file.
Pick whichever source applies. After installing, the language server itself needs no separate step — see Language server below.
- Download
tengo-<version>.vsixfrom the Releases page. - In VS Code: open the Command Palette (
Cmd/Ctrl+Shift+P) → Extensions: Install from VSIX… → select the downloaded file. Or from a terminal:code --install-extension tengo-<version>.vsix
Once published, search for Tengo (publisher popoffvg) in the Extensions
view, or:
code --install-extension popoffvg.tengoOn first activation (when you open any .tengo file) the extension locates the
tengo-lsp binary automatically, in this order:
- the
tengo.lsp.pathsetting, if set and pointing at an existing file; - a
tengo-lspfound on yourPATH; - otherwise it downloads the matching release binary from
popoffvg/tengo-lspand caches it in the extension's global storage.
No manual install of the server is required — it is fetched on demand the first
time you open a Tengo file. If the download fails (e.g. offline or an
unsupported platform), build tengo-lsp yourself and point tengo.lsp.path at
the binary.
Supported download targets: macOS (aarch64, x86_64), Linux (aarch64,
x86_64), Windows (x86_64).
| Setting | Default | Description |
|---|---|---|
tengo.lsp.path |
"" |
Path to the tengo-lsp binary. If empty, the extension searches PATH and then downloads a release build. |
npm install
npm run compile # one-off bundle: src/extension.ts -> out/extension.js
npm run watch # rebuild on change
npm run package # produce a local .vsix via @vscode/vscePress F5 in VS Code to launch an Extension Development Host with the extension
loaded.
Releases are automated by .github/workflows/release.yml.
Pushing a tag of the form vX.Y.Z triggers a workflow that:
- installs dependencies and compiles the bundle;
- sets
package.json's version from the tag; - packages
tengo-<version>.vsix; - creates a GitHub release with auto-generated notes and attaches the VSIX;
- publishes to the VS Code Marketplace and Open VSX if the corresponding tokens are configured.
# cut a release
git tag v0.1.1
git push origin v0.1.1Marketplace publishing is optional and skipped unless these repository secrets are set:
| Secret | Used for |
|---|---|
VSCE_PAT |
Publishing to the VS Code Marketplace (vsce publish). |
OVSX_PAT |
Publishing to Open VSX (ovsx publish). |
Without them, the workflow still builds the VSIX and attaches it to the GitHub release.
MIT — see LICENSE.