Lua runner with rich builtin stdlib
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
a/lua/stubs
Ondřej Hruška ccdbf1307c Rework http to not reinvent the wheel for cookies, add fs.getScriptDir() 2 weeks ago
..
README.md fix up lua lib and language server config, add stubs, move demos 2 weeks ago
fs.lua Rework http to not reinvent the wheel for cookies, add fs.getScriptDir() 2 weeks ago
http.lua Rework http to not reinvent the wheel for cookies, add fs.getScriptDir() 2 weeks ago
log.lua fix up lua lib and language server config, add stubs, move demos 2 weeks ago
os.lua fix up lua lib and language server config, add stubs, move demos 2 weeks ago
require.lua fix up lua lib and language server config, add stubs, move demos 2 weeks ago
sqlite.lua add prototype permission based fs access 2 weeks ago
task.lua fix up lua lib and language server config, add stubs, move demos 2 weeks ago
tui.lua fix up lua lib and language server config, add stubs, move demos 2 weeks ago
utils.lua fix up lua lib and language server config, add stubs, move demos 2 weeks ago

README.md

Lua stubs for the a runtime environment

---@meta type definitions of the Rust-native parts of the a stdlib, for lua-language-server (completion, hover docs, static checking). Definitions only — these files are never executed and are not part of the runtime.

The Lua-implemented parts of the stdlib need no stubs: lua/stdlib/*.lua are the actual sources and the language server reads them directly. The split:

Stub here Covers
tui.lua the whole tui module (fully native)
http.lua http requests, response shape, sessions
sqlite.lua sqlite.connect and the connection methods
log.lua log.tracelog.error
task.lua task.join
utils.lua native half: NULL, isNull, dump, toJSON, fromJSON (try/tryn live in lua/stdlib/utils.lua)
os.lua sandbox additions os.microtime, os.sleep
require.lua the sandboxed require (the stock package library is disabled in .luarc.json)

The sandbox itself is mirrored in the repo-root .luarc.json: runtime.builtin disables io, debug and package, which do not exist in scripts. lua-language-server cannot hide individual fields, so removed functions that live inside kept libraries (os.execute, os.remove, os.exit, load, loadfile, dofile, string.dump) still autocomplete — they raise at runtime, do not use them.

Keep these files in sync with the real API; the prose reference is docs/*.md.