VS Code extension
The official Nola extension, nola.nola-vscode, provides editing and debugging support for .tsi files. It includes the Nola language server and a tsserver plugin. No global installation is needed.
Features
Section titled “Features”- Syntax highlighting for
infer,ask, extractor templates, andask with <name>routing. - Diagnostics — Nola parse errors and TypeScript errors, reported at the original
.tsipositions. - Hover, completion, and go-to-definition inside
.tsifiles, including inside the${…}holes of an instruction. TypeScript errors point to their source range inside the template. - TypeScript interop. The bundled tsserver plugin gives
.tsconsumers types for their.tsiimports. Go-to-definition opens the originalinfer function. - Debugging. The “Nola: Launch File” configuration runs your entry point with the Nola loader. You can set breakpoints in
.tsi, step into infer functions, and inspect contextual parameters with debug hover.
Install
Section titled “Install”Install from the Marketplace, or run code --install-extension nola.nola-vscode. Both npm create nola and nola init --add write a .vscode/extensions.json recommendation unless you pass --ide none.
Requirements
Section titled “Requirements”- A Nola project. Create one with
npm create nola my-app, or runnola init --addin an existing project. - A directory-style
includeintsconfig.json. Use["src"]so the language server and tsserver plugin can include.tsifiles. A glob such as["src/**/*.ts"]excludes them. - TypeScript. The language server uses
node_modules/typescriptfrom your workspace, falling back to VS Code’s built-in copy. If neither is available, installtypescriptin the project. Scaffolded projects already declare it as a dependency.
You can open .tsi files before running npm install. The extension uses bundled runtime declarations until it can resolve @nola-lang/runtime from the project. After installing dependencies, run Developer: Reload Window so go-to-definition on runtime types opens the installed package.
Debugging
Section titled “Debugging”Add Nola: Launch File from Add Configuration… in launch.json, or use the configuration created by the scaffold. It runs node --import nola-lang/register --enable-source-maps with resolveSourceMapLocations and skipFiles set for .tsi debugging. Editor setup explains the full configuration.
Snippets
Section titled “Snippets”Type infer or ask in a .tsi file to see the available snippets.
| Snippet | Inserts |
|---|---|
infer |
An infer function |
inferc |
An infer function with a contextual parameter |
inferi |
An infer function with an instruction |
ask |
A typed extractor resolved with ask |
askfree |
An untyped extractor resolved with ask |
askwith |
An extractor routed through a named model |
calli |
A call intent |
extract |
A bare extractor |
Known limits
Section titled “Known limits”For another editor, configure @nola-lang/language-server and @nola-lang/typescript-plugin as described in Editor setup.
Next: Error codes