Editor integrations
cTurtle has a BT extension for VS Code and a BT plugin for JetBrains IDEs
(IntelliJ IDEA, CLion, and others). Both give you syntax highlighting, errors
as you type, completion, hover documentation, go-to-definition, find
references, rename, formatting and a debugger. They bundle the tools they
need: bt-lsp for code intelligence, bt-dap for
debugging, and ctbt and bt-run for running scripts. You do not need to
install anything else.
Open the folder that contains your game.json (or bt.module.json) so the
editor finds your project's include roots.
VS Code extension
Install the .vsix for your platform (bt-language-VERSION-linux-x64.vsix
or bt-language-VERSION-win32-x64.vsix) with Extensions: Install from
VSIX.... VS Code 1.90 or later is required. With Remote SSH, WSL,
containers or Codespaces, install it in the remote window.
Commands
- BT: Debug File or Folder... compiles and debugs a
.btfile or folder. It is also on the Explorer right-click menu. - BT: Restart Language Server restarts code intelligence, for example after changing engine versions.
Debugging
Add configurations to .vscode/launch.json. Give exactly one of target,
artifact or program:
{
"version": "0.2.0",
"configurations": [
{ "type": "bt", "request": "launch", "name": "Debug tool",
"target": "${workspaceFolder}/tools/convert.bt", "args": ["in.txt"] },
{ "type": "bt", "request": "launch", "name": "Debug artifact",
"artifact": "${workspaceFolder}/build/program.ctbt" },
{ "type": "bt", "request": "attach", "name": "Attach to game",
"port": 4711, "token": "my-secret" }
]
}
| Key | Description |
|---|---|
target | A .bt file or folder. It is compiled with debug information and run. The working folder defaults to the target's folder. |
artifact | A .ctbt file built with ctbt artifact --debug. |
program | An executable built with the debug runtime, such as a game built with bt_debug_runtime. |
args | Arguments for the program. |
cwd | Working folder. Default: the workspace folder. |
stopOnEntry | Pause before the first line. Default true. |
port, token | For attach: the port and token the game was started with. See Debug a running game. |
A launch with none of target, artifact or program asks you to pick a
file or folder.
Settings
You only need these to use tools other than the bundled ones, for example from your own engine build.
| Setting | Default | Description |
|---|---|---|
bt.server.path | bundled | bt-lsp to use. |
bt.server.trace | false | Log language-server requests, for troubleshooting. |
bt.debug.adapterPath | bundled | bt-dap to use. |
bt.debug.compilerPath | bundled | ctbt used to compile target launches. |
bt.debug.runnerPath | bt-run next to bt.debug.adapterPath if set, else bundled | bt-run used for target and artifact launches. |
JetBrains plugin
Install the plugin zip for your operating system with Settings | Plugins | Install Plugin from Disk.... It needs a 2026.1 (build 261) or later IDE with the built-in LSP support.
- Restart Language Server restarts code intelligence.
- Debug and run with a BT run configuration (Run | Edit
Configurations... | + | BT), or right-click a
.btfile and run it. Line breakpoints work in the editor gutter.
Run configuration kinds
| Kind | Runs |
|---|---|
| Target | A .bt file or folder. It is compiled first; for Debug it is compiled with debug information. |
| Artifact | A .ctbt file. Debugging needs one built with ctbt artifact --debug. |
| Native | An executable. Debugging needs one built with the debug runtime. |
| Attach | Attaches to a running game by port and token (debug only). See Debug a running game. |
The working folder defaults to the project folder (for Target debugging, the target's folder).
Settings
Settings | Languages & Frameworks | BT Language lets you point at your own
bt-lsp, ctbt, bt-run and bt-dap instead of the bundled ones, and turn
on request tracing. Settings are saved per project. If a tool is missing, the
IDE reports TOOL was not found at PATH and asks you to set it here.
Troubleshooting
| Problem | What to do |
|---|---|
This BT extension package does not contain TOOL for PLATFORM (VS Code) | You installed the .vsix for another platform. Install the one for your system, or set the tool's path setting. |
cturtle/... includes are unresolved | Open the folder that contains your game.json. |
| Your game's native functions show as unknown | See Engine and game APIs. |
Debugging fails with launch refused or cannot connect | See the bt-dap errors. |