Skip to main content

Editor Setup

This guide covers syntax highlighting and editor support for BtScript files (.bts).

VS Code​

Installation​

  1. Copy the vscode folder to your VS Code extensions directory:

    • Linux/macOS: ~/.vscode/extensions/btscript-0.1.0
    • Windows: %USERPROFILE%\.vscode\extensions\btscript-0.1.0
  2. Restart VS Code

Or for development:

cd editors/vscode
code --extensionDevelopmentPath=$(pwd)

Features​

  • Syntax highlighting for all BtScript constructs
  • Bracket matching and auto-closing
  • Comment toggling

Emacs​

Installation​

Copy emacs/btscript-mode.el to your Emacs load path and add to your init file:

(require 'btscript-mode)

Or with use-package:

(use-package btscript-mode
:load-path "/path/to/btscript/editors/emacs"
:mode "\\.bts\\'")

Features​

  • Syntax highlighting for keywords, special forms, built-ins
  • SRFI-88 keyword highlighting (word: postfix style)
  • Pipe-quoted symbol highlighting (|btft:task-name;1.0.0|)
  • Automatic indentation
  • Comment support (;)
  • Imenu integration (navigate flows, tasks, functions, structs, enums)
  • Electric pairs for parentheses and strings

IntelliJ IDEA / Rider​

Installation​

  1. Open Settings > Editor > TextMate Bundles
  2. Click "+" and select the btscript.tmbundle directory
  3. Restart the IDE

Features​

  • Syntax highlighting via TextMate grammar (same as VS Code)

What Gets Highlighted​

ElementExampleTypical Color
Special formsflow, task, function, trigger, let, defstructPurple/keyword
Keywordsid:, window:, as:, version:Blue/type
Built-in functionsrolling-avg, latest, ceiling, array-avgCyan/function
Operators+, >, and, modOperator
BTI referencesbtft:rolling-avg;1.0.0Type
Pipe-quoted symbols|btft:task;1.0.0|Type
DurationsPT5M, PT1H30SNumber
Strings"sensor.temp"String
Numbers42, 3.14Number
Booleanstrue, #fConstant
Definitionsfunction/variable/struct namesFunction/variable/type
Predicatesnull?, is-valid?Function
Mutatorsset!, clear!Warning
Comments; commentComment