RokuCommunity February 2025 Updates
Debug protocol by default, LSP rewrite, rooibos mocha reporter, and more!
Hey everyone, Bronley here from RokuCommunity. I wanted to share some exciting new changes happening in RokuCommunity.
Debug Protocol is now the default debugger
We first introduced debug protocol support back in April 2020 (off by default), and and it’s been over a year since we ran a trial to enable the debug protocol by default. The community raised many valid concerns during that trial, and we believe we have addressed almost all of them at this point. As of Monday February 10, we have enabled the debug protocol as the default debugger in the BrightScript VSCode extension, starting in v2.55.0!
Moving forward, we are focusing our efforts on the debug protocol. This means that the telnet debugger is unlikely to receive larger updates in the future. If you run into any issues with the debug protocol, please feel free to open a GitHub issue and we'll do our best to help. We believe these improvements will significantly enhance your debugging experience. However, you can always revert back to the telnet debugger by setting “enableDebugProtocol”: false
in your launch.json if you’re encountering issues.
Here’s an overview of some of the most impactful debug protocol improvements:
Virtual variables
We've added support for many virtual variables, allowing you to inspect values that previously required running commands in the debug console. You can browse the customVariables folder in roku-debug#209 for the full list of virtual variables supported and what functions they correspond to.
Call stack navigation
Using the debug protocol allows you to walk up and down the call stack and inspect variables at each stack location. Here’s a quick preview of call stack navigation in action:
Modify breakpoints during an active debug session
The debug protocol supports dynamically adding and removing breakpoints during an active debug session. Previously (in the telnet debugger) it would require a full stop and start due to how it writes stop
statements in your code before deployment. Check out our 2022 developer conference presentation for a demo of dynamic breakpoints in action.
Faster variable lookups and stability
Resolving variables is faster in the debug protocol compared to our telnet debugger. Here’s a quick video showing that.
Our telnet debugger works by sending text commands, and scraping the output logs for data. This process is very slow, and also brittle, especially when we encounter unexpected output. The debug protocol on the other hand, is a binary protocol, so all data is being streamed in a more efficient data structure, and is encapsulated into precise request/response structures for our debugger needs.
Overall, we’ve found the debug protocol to be much more stable than our telnet debugger across all aspects of the debug session. It crashes less frequently, and due to a defined binary protocol, we are able to avoid many pitfalls that our telnet debugger encounters due to misinterpreting the raw telnet output. You can read more about the debug protocol in the official Roku documentation.
Other Debugger enhancements
We’ve also added a few other improvements to the debugger experience this month. Here are the highlights:
New Registry scope
We've added a new "scope" to the variables panel which shows the data stored in the registry, remaining registry space, application IDs that share space with the current developer ID, and the currently signed developer ID on the device.
REPL completions
We’ve added preliminary support for completions in the REPL (that box at the bottom of the debug console). Now when you start typing, you should see completions for local variables, global functions, property names, etc. Here’s a quick demo:
Language Server rewrite
The BrightScript VSCode extension is responsible for providing most of the in-editor help for Roku projects such as, completions, hovers, validation, syntax highlighting, and more. All of that functionality is powered by the Language Server Protocol.
We started a full rewrite of our Language Server implementation back in November 2023 (yes, it’s been over 2 years in the making at this point). We’re happy to announce that effort has been completed and was released as part of BrightScript VSCode extension v2.55.0 and brighterscript v0.69.0.
We’ve made significant improvements to the architecture of the language server. We won’t go into too much detail, but here are the highlights:
We’ve fixed several issues where validation ran continuously
Project validation now runs on background threads, unblocking the language server and speeding up request handling. Each workspace project runs in parallel which should also improve performance for teams with multiple projects. To disable this feature, set
brightscript.languageServer.enableThreading
tofalse
in your user/workspace settings.We’ve optimized how ignored files are handled. Previously the language server would incorrectly trigger validations for many unnecessary filies (especially during git commands or debug launches). Now it will read your
files.exclude
vscode setting,.gitignore
entries, and also thefiles
array from everybsconfig.json
in the workspace. This should result in much more stable validations since we’re now skipping unrelated files.We've improved handling for completions, hovers, and other similar interactions by pausing validation during these requests to provide faster responses, then resuming validation afterward. This significantly speeds up interaction times. See the videos below for a quick example:
Before (yes, this is a worst-case situation in a huge project):
After:
Check out brighterscript#993 for more information.
Mocha style reporting in Rooibos
As of v5.15.1, Rooibos now includes a new "mocha" reporter, inspired by the popular Mocha JavaScript framework. This new reporter enhances error messages with richer diffs, making it easier to identify discrepancies in objects or strings. This should make determining the cause of test failures easier to understand! In addition to this new reporter, many bugs related to assertions and async tests have been resolved.
You can enable the new reporter (along with the pretty ASCII colors!) by using these settings:
"rooibos": {
...
"colorizeOutput": true,
"reporters": [
"mocha"
]
}
Sunsetting the “what’s new” writeups
For the past few years we’ve tried to send out monthly updates about the latest RokuCommunity news. While we believe these updates provide value and foster engagement with the community, dedicating time each month for these updates was clearly too ambitious on our part. We feel our biggest impacts come in the form of providing solutions for our community, and we want to focus on that.
Instead of monthly updates, we’ll be transitioning to sending larger updates on a less frequent basis. So make sure you’re subscribed!
We hope to one day bring back the monthly updates, and if anyone in the community is interested in helping maintain them, we'd love to hear from you!
Wrap up
That’s it! We hope you are excited about these new features (we are!), and hopefully we haven’t completely broken your development workflows. As always, you can reach out to us on Slack or GitHub if you have any questions or would like to contribute.