Language support for Sema, a Lisp dialect with first-class LLM primitives.
Install
Install from the VS Code Marketplace:
ext install helgesverre.sema
Or open the Extensions view (Cmd+Shift+X / Ctrl+Shift+X) and search for Sema.
If the Marketplace listing isn't available yet (publish pending), build and install the .vsix locally — see Building from source.
Features
- Syntax highlighting for
.sema files (special forms, builtins, LLM primitives, keywords, strings, numbers, regex/f-string literals, and more)
- Bracket matching, auto-closing, and surrounding pairs for
(), [], {}, and strings
- Comment toggling with
Cmd+/ / Ctrl+/
- S-expression-aware indentation
- File icons for
.sema and .sema-nb files
- Language server (
sema lsp): completions, hover docs, go-to-definition, references, rename, signature help, diagnostics, document symbols, and inline eval results
- Debugging (
sema dap): step-through debugging with line/conditional breakpoints, step in/over/out, stack traces, variable and upvalue inspection, evaluate-on-hover, pause/continue, and an "Uncaught Exceptions" filter
- Notebooks: open a
.sema-nb file to edit it in the embedded Sema notebook UI with live cell execution
- Command:
Sema: Clear Inline Results to clear inline eval decorations
Requirements
The language server, debugger, and notebook features shell out to the sema binary. Install it from sema-lang.com and make sure it's on your PATH, or point the extension at it explicitly:
{
"sema.path": "/absolute/path/to/sema"
}
Syntax highlighting and bracket/comment editing work without the binary.
Debugging
The extension bundles a debug adapter backed by the sema dap server. Add a launch configuration to .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "sema",
"request": "launch",
"name": "Debug Sema Program",
"program": "${file}",
"stopOnEntry": false
}
]
}
Then press F5 in a .sema file.
Notebooks
Opening a .sema-nb file launches sema notebook serve for that file and embeds its web UI directly in the editor tab (live cell execution, one server per open notebook, stopped when you close the tab). It uses the same sema.path binary — no extra setup.
Building from source
npm install
npm run compile
npx @vscode/vsce package
This produces sema-<version>.vsix, which you can install with:
code --install-extension sema-<version>.vsix
Development
- Open this repository in VS Code
- Run
npm install
- Press
F5 to launch an Extension Development Host
- Open any
.sema file to see syntax highlighting and, if sema is installed, the language server
Links
License
MIT © Helge Sverre