A mix of logs (Lua, JavaScript, Plugs, Service Worker) and a Lua REPL. Enter Lua expressions, and they will be evaluated.
${widgets.commandButton("Workbench: Console")} opens this tab in the Workbench.
The log collects:
print in your scripts, with a link to the line that printed it, plus everything you run in the REPL.The log keeps the most recent 1000 entries. Use the filter field to search them (a plug’s name matches too), and the All, Lua, JS, Plug, SW and Error buttons to show one source, or only errors.
Lua errors show their message, a hint when there is one, and the offending line with the failing part marked. Stack lists where the error passed through.
Type Lua at the bottom prompt and press Enter to run it. For a first experiment, enter 1 + 2. The result is 3. Console code can change your space when you call a write API, so use your own writable space for mutation examples.
The REPL can operate in two “contexts”:
What you can enter in the REPL:
1 + 2 shows 3, and "a", "b" shows both values. A statement, like an assignment or a loop, shows nothing unless it ends with return.local you define stays available to later input, until you reload the page.function f() or an open {, Enter starts a new line instead of running it. Shift-Enter always starts a new line.Results that are tables, lists or records render the way a ${…} expression would render them on a page: query results as tables, widgets as widgets. Use the Rendered and Lua toggle on a result to switch to the underlying Lua value instead.
Hover a log entry and click the three-dotted menu for options that depend on the entry type:
Copy as ${…} (for a single expression, so you can paste it into a page), Copy code, and Run again (using the entry’s original context).${…} widget.