Skip to content

Search

Documentation

script module

Loads other scripts, inspects what they declare and calls into them; a failure stays contained.

Ezen az oldalon

Loads other scripts, inspects what they declare and calls into them; a failure stays contained.

19 functions, 0 constants. Scripts reach it as script::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

function acts on what it does
api() — Every module scripts can reach, as the JSON string balaur api prints; a tool reads the live engine rather than a file that may be stale.
attempt(f: fn) — Call a function, answering (true, value) when it returned and (false, message) when it failed.
check(path: string, source: string) — Every compiler diagnostic about the given source, as [#{ file, line, column, severity, message }]; an editor passes the buffer it is showing.
complete(path: string, source: string, line: int, column: int) — Every completion valid at that caret, as [#{ label, kind, detail, doc, insert }]; an editor passes the buffer it is showing.
definition(path: string, source: string, line: int, column: int) — Where the name at that caret is defined, as #{ file, line, column, url }; engine API carries its reference page rather than a file.
exports(path: string) — The tunable properties a script declares in exports(), with their defaults.
find(path: string, source: string, needle: string) — Every place that text appears across the files this one's mod declarations reach, matched as text rather than as an identifier.
format(path: string, source: string) — That source laid out by Rune's own formatter; the source unchanged when it will not parse.
functions(path: string) — The public functions a script file declares, with their argument names.
hover(path: string, source: string, line: int, column: int) — What is under that caret, as #{ title, detail, doc }, or () when it is nothing the engine knows.
references(path: string, source: string, name: string) — Every place that name appears as a whole word across the files this one's mod declarations reach, as [#{ file, line, column, url }].
rename(path: string, source: string, from: string, to: string) — Every file a rename would rewrite, as [#{ file, source }]; nothing is written, so a caller can show the list first.
replace(path: string, source: string, from: string, to: string) — Every file a find and replace would rewrite, as [#{ file, source }]; nothing is written, so a caller can show the list first.
require(path: string) — Load another script file as a module, compiled once and shared by every caller afterwards.
shared(f: fn) — Wrap a script function so another script's code can call it, with whatever arguments the caller brings.
signature(path: string, source: string, line: int, column: int) — The call the caret is inside, as #{ title, detail, doc, active }, where active is the argument being typed.
store(key: string, value: any) — Keep any value under a key for as long as the app runs, held by reference: state no node owns, like a class's static variable.
stored(key: string) — What store kept under a key, the same value rather than a copy; nil when nothing was.
symbols(path: string, source: string) — What that file declares, as [#{ name, kind, detail, line, column }]: its public functions and its exports() properties.