Repository navigation
v0.49.0
Highlights
One-line if. An if, elif or else that does one thing can be written on one line with =>, like match arms and fn(x) =>:
if $score >= 90 => return 'A'
if $temperature < 5 => echo 'Cold'
elif $temperature < 20 => echo 'Mild'
else => echo 'Warm'
Constants from other scripts in the editor. With const puzzle_input = ... in lib/puzzle-input.kscript, typing puz or $puz in main.kscript offers $puzzle_input. Picking it adds import "lib/puzzle-input.kscript" when the file isn't imported yet.
Fixes
$puzzle_inputwritten without its import now says which file declares it, with an Import lib/puzzle-input.kscript quick fix (or Change to $day.puzzle_input when the file is imported asday).- A line that is only a value's name (
puzzle_input) now says to write it with its$, with a fix that writes it (and the import, when one is needed). - At the start of a line, a constant is offered as
$limitinstead oflimit, since a constant can't be given a new value. - Typing the
{that opens afor,while,if,else,tryorcatchblock no longer opens suggestions, so Enter starts a new line instead of writingecho. - Inside a
collection, the editor suggests and allows onlyitem.
What's Changed
- Quiet suggestions after a block's opening brace; a collection suggests only item by @kylepantall in #347
- One-line if with =>: if $continue => @method_call() by @kylepantall in #348
- Suggest constants from other project scripts, and import them when picked by @kylepantall in #349
Full Changelog: v0.48.1...v0.49.0