Syntax highlighting, LSP diagnostics, completions, hover information, and document symbols for .cat files (CatLang / Catpile DSL).
Catpile is a Pythonic DSL that compiles to CatWeb JSON for Roblox CatWeb scripts. This extension provides a full editing experience for .cat files inside VS Code.
Catpile Docs • GitHub • PyPI • Web Editor
Requirements
- catpile Python package installed in the Python environment VS Code uses:
pip install catpile - VS Code 1.85 or newer
Installation
From VS Code Marketplace
Search for "Catpile" in the Extensions view (Ctrl+Shift+X) and click Install, or run:
code --install-extension swirx.catpile
From VSIX
git clone https://github.com/SwirX/catpile-vscode.git
cd catpile-vscode
npm install
npx @vscode/vsce package
code --install-extension catpile-*.vsix
Configuration
| Setting | Default | Description |
|---|---|---|
catpile.taste |
indent |
indent (Pythonic) or bracket (JS-style { }) |
catpile.defaultScope |
local |
Default variable scope when no l_/g_/o_ prefix |
catpile.pythonPath |
python3 |
Path to the Python interpreter with catpile installed |
catpile.lspLogLevel |
warn |
Server log verbosity |
Features
Syntax highlighting
- Keywords:
on,fn,script,if,else,repeat,foreach,break,return - Event names highlighted separately from action calls
- Scope-prefixed variables (
l_name,g_name,o_name) get distinct colouring - String interpolation
{varname}inside"..."is highlighted - Both comment styles:
#(indent taste) and//(bracket taste) - Dotted UI paths:
page.element.sub
Diagnostics
- Syntax errors from the parser reported inline with line + column
- Unknown action name warnings (catches typos in action calls)
- Unknown event name warnings (e.g.
on laoded:) - Missing
:at end of block headers (indent taste)
Completions
- All 122 actions with full signature snippets (tab stops per parameter)
- All 14 events with
on <event>:snippets - Control-flow snippets:
if,if/else,repeat,repeat_forever,foreach,fn,script - UI element path completions from
.catuifiles in the workspace (triggered by.) - Variables seen in the current document
Hover
Hover over any action or event name to see:
- Canonical name and schema id
- Human-readable signature with slot types
- UI path globalID (when hovering a dotted path)
Document symbols
The outline panel (Ctrl+Shift+O) shows:
script "Name"blocks as top-level containerson <event>handlersfn <name>function definitions
LSP server location
The extension ships a thin launcher at server/run_lsp.py that starts the LSP from catpile's installed package. The actual server logic lives in catpile/lsp.py.
To replace the built-in LSP with a newer version, update catpile/lsp.py in the catpile package and reinstall (pip install -e . works).
Commands
| Command | Description |
|---|---|
Catpile: Restart Language Server |
Re-launches the LSP process |
Catpile: Show Server Output |
Opens the Catpile output channel |
License
This extension is distributed under the GNU General Public License v3.0. See LICENSE for details.