Skip to content

v0.5.0

Choose a tag to compare

@treytomes treytomes released this 28 Nov 02:01
· 9 commits to main since this release

Nnavigation that follows new to its class, fields and shadowed imports, imports followed across files, quick fixes beside the squiggle, the Run commands, and a Testing panel that stays current.

GRFON

A .grfon file opens as GRFON, with a TextMate grammar whose rules follow the format's own reader, lib/grfon.ms: // comments that stop at a url's ://, keys before an unescaped colon, backslash escapes, whole-token numbers and null, with true and false left as the text GRFON reads them as. The document layer over it is colored too — @group references with their arguments, ?term, $.path, and the <name> placeholders a takes: group fills. Braces, comments and indentation come from a language configuration, so // toggles and } indents the way the format does.

The grammar has a test of its own: it tokenizes sample lines and every services/*.grfon through the real tokenizer, and an editor check opens a declaration in a real VS Code and asserts the file's language and the grammar the manifest contributes.

Classes and instances

new Shape now gives a name the class's methods: completion after sq., hover, Ctrl-click, signature help and the semantic colors all read the instance the file proved, and self and super resolve through the enclosing method's class. A field a method sets with self.sides = 0 is a member of that class, so sq.sides hovers, jumps and counts as a use. A member the class does not have is a diagnostic that offers the close name.

Imports across files

import "sizes" and import "../sizes" are followed out of the file: Shift+F12 on sizes.helper lists the module's declaration and its uses, including every importing file's sizes.helper, and Rename rewrites them together. The import's quoted path is a link, and sizes. completes the module wherever the importing file sits. A name the importing file owns — a local, a parameter, a top-level name — shadows the alias there, so it is neither listed nor rewritten, and hover, Ctrl-click and the parameter popup agree with that reading.

Quick fixes

The two problems that can be repaired with certainty carry the repair: a misspelt member offers the close name, and an end that names no open block inserts the one that closes it, indented as its block.

Running

Run commands open the file in a terminal in its project folder, the file with arguments prompted for and passed as typed, the selection in a MiniScript REPL so a name one selection defines is there for the next, or a REPL on its own in the project folder. The REPL is kept until its terminal closes, and a missing interpreter is reported rather than opening a terminal.

The Testing panel

The panel merges rather than reloads: a save queues one rediscovery behind a debounce, a check that moved keeps its item and has its range moved, one that is gone leaves with its file, and each run writes the suite's own totals into the output. Only the files whose checks the panel shows are watched, and a save during a run does not start a second one.

Editor checks

npm run test:editor launches a real VS Code and asks its own commands for a hover, a completion, a diagnostic and a semantic token, and now also for the GRFON language of a .grfon document. Every provider also answers inside a notebook cell.

Installing

Requires VS Code 1.75 or newer. Attach the .vsix below with Extensions: Install from VSIX…, or from a terminal:

code --install-extension miniscript2-0.5.0.vsix