Repository navigation
v0.50.0
Highlights
A step debugger in VS Code. Press F5 in a .kscript or .ks.xml script, or click Debug above its first line, and it stops at your breakpoints.
- Step Over (F10), Step Into (F11), Step Out (Shift+F11), Continue and Pause. Block functions such as
->map(fn(n) { ... })are stepped into as their own frame. - Breakpoints with conditions, hit counts (
3,>= 3,% 3) and log points. - The Call Stack shows every function the script is inside, each with Locals, Globals and Built-in variables. Lists, maps and records open to show their items.
- Hovers, watches and the Debug Console work out expressions in the selected frame.
- The script pauses where an error is thrown, before anything catches it.
The debugger is also available to other editors as kscript debug (the Debug Adapter Protocol on stdio). See docs/debugging.md.
Variables have their $ everywhere. A variable is now written the same way where it is declared, changed and read:
$apples = 12 // declares
$apples += 1 // changes
$count: int = $raw // declares with a type
const $tax = 0.2 // never changes
echo $apples
Breaking changes
- The bare spellings
apples = 12,count: int = 4andconst tax = 0.2are now KS6010 errors. The quick fix adds the$, andkscript check --fixrewrites a whole project. Parameters and loop items stay bare (fn double(n),for item in $list), and inside a type's methods a field is still.count += 1. See docs/upgrading.md.
Not yet
- Debugging test files,
@ask()input while debugging, and editing values in the Variables view.
Run kscript update to get this release.
What's Changed
- Add a step debugger: breakpoints, stepping and variables in VS Code by @kylepantall in #350
- Declare and assign variables with their $: $x = 12 by @kylepantall in #351
Full Changelog: v0.49.0...v0.50.0