Skip to main content

Features

Everything the extension can do, grouped by what you're working on. New here? Start with the Quick Start.

Debugging a Roku app in VS Code

Writing code​

The language features are powered by the BrighterScript language server, and work for both BrightScript (.brs) and BrighterScript (.bs) files with no configuration for standard Roku projects (Editing Setup).

  • Real-time validation: syntax errors, undefined functions, wrong argument counts and more, as you type. Problems can be ignored per line or per file.
  • Syntax highlighting for BrightScript, BrighterScript and the code in SceneGraph XML files
  • Code formatting, configurable through the brightscript.format.* settings
  • Navigation: go to definition (F12), peek definition (Alt+F12), find all references (Shift+F12), document symbols (Ctrl/Cmd+Shift+O) and workspace symbols (Ctrl/Cmd+T)
  • XML support: go to definition from an XML component to its extends component, its script imports and the functions it references
  • Toggle XML/BRS to jump between a component's .xml and its code-behind file, and Go To Parent Component
  • Signature help for function parameters (open parenthesis, or Ctrl/Cmd+Shift+Space)
  • Snippets for common BrightScript and SceneGraph code
  • Preview transpiled code: see the BrightScript a BrighterScript file compiles to
  • Pick your BrighterScript version with the brightscript.bsdk setting, i.e. to match the version your project builds with

Running and debugging​

See Debugging Setup to get started, and Launch Configuration for every option.

  • One click debugging: package your app, side-load it onto a Roku device and attach the debugger, from the Run and Debug panel or with F5
  • Breakpoints, including conditional breakpoints, hit counts and logpoints, plus stepping, the call stack, and variable inspection
  • Debug Console: your app's output, and a console to run BrightScript while the app is paused
  • Source maps, so breakpoints and errors map back to your original source when you build with your own tools
  • Component libraries: package, host and side-load component libraries alongside your app
  • Deep linking: launch your app with a deep link
  • bs_const values set from your launch configuration
  • Variable substitutions like ${promptForHost}, and values from a .env file
  • Advanced project setups, like custom build scripts and source files spread across several folders
  • RALE: inject the Roku Advanced Layout Editor tracker task without committing it to your repo
  • SceneGraph debug commands (port 8080) from the command palette, like chanperf, sgnodes and fps_display, or run them automatically at the start of every session with autoRunSgDebugCommands
  • Profiling: control BrightScript profiling (bsprof), and record Perfetto traces and heap snapshots

Device tools​

These panels show up in the Run and Debug sidebar.

  • Devices: every Roku on your network (found automatically) plus the devices you add in your settings, with their details. Pick which one to deploy to. See How Devices Are Discovered for how the list is kept up to date.
  • Roku Device View: a live view of the device's screen
  • SceneGraph Inspector: browse the running app's SceneGraph node tree, inspect and edit node fields, and see node counts by type
  • Roku Registry: view and edit the app's registry
  • Roku File System: browse the files on the device, across all of its volumes (like pkg:/ and tmp:/)
  • Roku App Overlays: lay images over the Roku Device View, i.e. to compare your UI against a design mockup
  • RTA Tools: send any Roku Test Automation command to the device, and test how your app behaves under memory pressure
  • Roku Automation: build and run scripted sequences of steps, like key presses and text entry
  • Roku REPL: run BrightScript on the device while your app is running
  • Rendezvous: track rendezvous (thread synchronization) between threads, to find what's slowing your app down. Needs logrendezvous turned on, which autoRunSgDebugCommands can do for you.
  • Solid Devtools: a live component tree and inspector for apps built with SolidJS

Controlling the device​

  • Remote control mode: use your keyboard as a Roku remote
  • Commands to send text to the device, change its volume or input, and restart the app that's installed
  • Roku Cloud Emulator: manage your cloud emulator devices from the Device Manager panel, and debug on them like any other Roku

Device logs​

The BrightScript Log output panel shows the device's output.

  • Clickable pkg:/ paths: Alt+click a pkg:/ path in the log to open that file in your project. Choose how they're shown with the brightscript.output.hyperlinkFormat setting:
    • Full: pkg:/components/KeyLogTester.brs(24:0)
    • FilenameAndFunction: KeyLogTester.DoSomething(24:0)
    • Filename: KeyLogTester.brs(24)
    • Short: #1
    • Hidden: no link text at all
  • Filters: show only the lines you care about with a log level filter (i.e. ^\[(info|warn|debug)\]), an include filter (i.e. NameOfSomeInterestingComponent) and an exclude filter (i.e. NameOfSomeNoisyComponent)
  • Mark the log (Ctrl+L) to make it easy to find where something started
  • Clear the log (Ctrl+K). Use the extension's command to clear it (rather than VS Code's), or the clickable links and filters can get out of sync.
  • The log is searchable, and can be colorized with an extension like Output Colorizer

See Keyboard Shortcuts for all of the shortcuts.

Tasks​

BrightScript tasks automate your build and deploy workflow, with interactive folder selection (${folderForFile: <glob>}), custom shells and environment variables, problem matchers, and background tasks for watchers and dev servers.