Builtin Library
README.md
code
The editor's code panel: the file the Files panel opens on a double-click, in
a code editor with line numbers, folding for Luau, syntax colour from
modules.highlight, the LSP's diagnostics under the lines they name, and a
Save button. The same panel shows a diff (openDiff) — the change an agent
made, hunk by hunk with both line-number gutters.
Save writes the file's source in play as in edit: the saved text reloads into the running play session and is still the file's text after Stop.
The code panel is the user's own editor. An agent that wants the user to read
a file opens it in a panel of its own with the show toolbox: show.file
for a file, folder or asset, show.text for text the agent wrote.
Reading a symbol
In a Luau file the pointer over an identifier shows what it is where it
stands. lsp.symbolAt(path, line, col, name, chain) runs the same typed pass
a check of the file runs — the API surface, the globals the file's context
injects, and the module every require names — so a local bound to a
required module shows that module's exports, and a value reached through it
shows the type the module declared. The hover leads with a header in code:
function entity.spawnSynced(name: string) -> entityProxy,
local total: number, (parameter) n: number, (field) crate.component: { 12 members }, namespace entity: { 41 members }, module Highlight: { 6 members }. Under it comes the documentation — the comment block above a
declaration the file makes, the header comment of a required module, or the
API page filed under the access path — then the parameters it documents, its
examples as code, then a table's members by name. A word in a
comment or a string is no reference, so nothing shows for it, and a file that
is not Luau shows nothing at all.
A secondary click on an identifier opens a menu on it:
- Go to Definition puts the caret on the declaring line and scrolls it
into view (
revealLine+revealEpochon the editor), when the file introduced the name; an API global has no line to go to and the item is dimmed. - Inspect puts the hover's header on the toolbar's status line.
Exports
The panel record carries openFile(path), openDiff(title, files),
pathHealth(path) and healthEpoch() for the panels that reach it through
edui.shell.panel("code").