Skip to main content

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 .bt file 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" }
]
}
KeyDescription
targetA .bt file or folder. It is compiled with debug information and run. The working folder defaults to the target's folder.
artifactA .ctbt file built with ctbt artifact --debug.
programAn executable built with the debug runtime, such as a game built with bt_debug_runtime.
argsArguments for the program.
cwdWorking folder. Default: the workspace folder.
stopOnEntryPause before the first line. Default true.
port, tokenFor 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.

SettingDefaultDescription
bt.server.pathbundledbt-lsp to use.
bt.server.tracefalseLog language-server requests, for troubleshooting.
bt.debug.adapterPathbundledbt-dap to use.
bt.debug.compilerPathbundledctbt used to compile target launches.
bt.debug.runnerPathbt-run next to bt.debug.adapterPath if set, else bundledbt-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 .bt file and run it. Line breakpoints work in the editor gutter.

Run configuration kinds​

KindRuns
TargetA .bt file or folder. It is compiled first; for Debug it is compiled with debug information.
ArtifactA .ctbt file. Debugging needs one built with ctbt artifact --debug.
NativeAn executable. Debugging needs one built with the debug runtime.
AttachAttaches 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​

ProblemWhat 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 unresolvedOpen the folder that contains your game.json.
Your game's native functions show as unknownSee Engine and game APIs.
Debugging fails with launch refused or cannot connectSee the bt-dap errors.