Skip to content

v0.3.0

Choose a tag to compare

@treytomes treytomes released this 24 Nov 02:20
· 36 commits to main since this release

Reads your .ms files without running them, so a name can be explained and followed from where it is used.

Hover documentation

Hover a function or method for its signature and its docstring — the first constant string in its body, the same note info(@f) reports. A function documented with a // comment above it instead shows that, and so does a variable, along with its assignment.

Ctrl-click to a definition

Ctrl-click (Cmd-click on macOS, F12 or Go to Definition) a name to jump to the line that assigns it. A name local to the function you are in wins over one defined elsewhere, and owner.name looks for a method of that name on that receiver.

The Outline

The Outline and the breadcrumb above the editor list the file's functions, methods, classes and top-level variables, with a method under its class and a nested function under the one that holds it. MiniScript declares nothing, so a symbol is whatever a line assigns — a capitalised name given a map or a new is read as a class.

Imported and workspace names

import "knowledge" makes knowledge a name for knowledge.ms, so knowledge.loadFacts reads that file, and Ctrl-clicking the string on the import line opens it. A name found in neither this file nor an imported module is looked for in the workspace's other .ms files, and Ctrl-click lists every file that defines it.

MiniScript's own names

print, s.len, xs.push(value), file.readLines(path) and the rest of the language's intrinsics are documented from its tables, and get no Ctrl-click, since there is no line to jump to. A member's type is read from the value its receiver was given, so s = "text" makes s.len the string's; when the value says nothing, every type that has that member is listed.

Hovering inside a string or a comment shows nothing: a name there is text.

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.3.0.vsix