Repository navigation
Added
- Formatting of
.menufiles (textDocument/formatting,/rangeFormattingand
/onTypeFormatting;src/server/formatting/menuFormat.ts), layout-preserving like Lua
formatting. The formatting selector (FORMAT_SELECTOR, formerlyLUA_SELECTOR) adds the
ie-menulanguage and**/*.[mM][eE][nN][uU].- Only white space the engine's lexer skips changes (IESDP, MENU file format, Lexical
structure). Each line is indented by the{ … }blocks open at its start; a line that starts
with}is indented like the line that opened the block. Trailing white space is removed and
blank lines are emptied. The spacing within a line is kept, and the lines of a string that is
not Lua (text "…") are never touched. - Each Lua chunk is formatted by the Lua rules (
formatEmbedded, new in
src/server/formatting/format.ts), its lines one level deeper than the line where it starts
(action ", or a"on its own line).`blocks outside any{ … }block hold a file's
top-level Lua and stay at level 0. A line that starts with the closing backtick or quote is
indented like the line where the chunk starts. The white space before the first Lua item on
the opening line, and after the last one on the closing line, is kept. - The character before a closing backtick, which the engine drops, stays white space or is
not touched. A chunk with a Lua syntax error (including Lua the engine sees cut short by
that dropped character) is left as written, the rest of the file is formatted, and the count
is logged. - A file with an unterminated string or
`block is not formatted (logged). The result is
lexed and extracted again and must give the same menu tokens, Lua chunks, Lua tokens and
comments, problems and lines, or nothing is changed. - Range formatting keeps the edits of the touched lines. On-type formatting uses the Lua
triggers: a line break formats the line it ended; the last character of a Lua closer, or a
}of the menu, that starts its line re-indents that line.insertFinalNewlineand
trimFinalNewlinesare honored for document formatting.
- Only white space the engine's lexer skips changes (IESDP, MENU file format, Lexical
data/luajit/manual.jsonand its generatorscripts/luajit-manual/(npm run luajit-manual,
-- --checkin the new CI jobluajit, run when the generator, the shared converter or either
data file changes; pinned sources cached by key). The data describes the LuaJIT that EEex's
"Use LuaJIT" component installs:LuaJIT/VERSION.TXTof Bubb13/InfinityLoader (pinned commit)
names the LuaJIT commit, and the text comes from that commit's documentation (extensions.html,
ext_buffer.html,ext_jit.html,ext_ffi_api.html) and from Lua BitOp 1.0.4doc/api.html
forbit.*, word for word. What exists comes from the build's own sources:lib_init.c
(libraries opened as globals and preloaded forrequire) and thelib_*.cregistrations,
with the feature flags ofmsvcbuild.bat(LUAJIT_ENABLE_LUA52COMPAT) aslj_arch.hderives
them. Every documented name must be registered, and every Lua 5.2 manual entry that the build
lacks is listed (onlybit32and its functions). Every file is verified by SHA-256; anything
the generator does not model stops it with the file and line.- Setting
ieLua.runtime.lua(lua52(default) |luajit,resourcescope, localized in every
manifest locale), read per document through the server's oneSettingsStore, now shared by
diagnostics, hover, completion and semantic tokens. Withluajit, the libraries described
(Libraryinsrc/server/hover/knowledge.ts) are the Lua 5.2 manual's minus the entries
data/luajit/manual.jsonlists as unavailable (bit32), plus the LuaJIT globalsbitandjit;
ffi,string.buffer,table.newandtable.clearare known asrequiretargets. Hover and
completion handlers read the setting before answering (then re-check the document and the
cancellation); completion items carry the runtime indata, socompletionItem/resolveuses
the same library (items without it resolve with Lua 5.2); semantic tokens are cached per
document and runtime, and a settings change sendsworkspace/semanticTokens/refreshwhen the
client supports it. Syntax validation follows the setting too (next entry). The LuaJIT and Lua
BitOp licenses, recorded verbatim in the data, are added toTHIRD_PARTY_NOTICES.md. - Syntax diagnostics by LuaJIT's own lexer and parser when
ieLua.runtime.luaisluajit
(src/server/validation/luajit.ts), in.luafiles and in every compiled form of.menu
Lua, so1LL,0x10ULL,3i,0b101and"\u{20AC}"are no longer errors there. The
checker is chosen per document; LuaJIT is loaded on first use. When the setting changes, open
documents whose diagnostics came from the other compiler are checked again, in every validate
mode. Messages are LuaJIT's own (near '<eof>'maps to the end of the chunk:
parseLuaError(raw, dialect)inluaError.ts). Productiondist/server/server.jsgrows from
810,957 to 1,058,231 bytes.third_party/luajit/(npm run build:wasm:luajit,-- --checkin the new CI job
luajit-wasm): theLuaJIT/directory of Bubb13/InfinityLoader at the commit the LuaJIT
manual data uses, fetched with git and verified by its tree hash (source.mts), is built to
WebAssembly following LuaJIT'ssrc/Makefileandmsvcbuild.bat(host tools compiled by
emcc and run by Node). Everylj_*.candlib_*.cis compiled unchanged, with
msvcbuild.bat'sLUAJIT_ENABLE_LUA52COMPATand the target optionsLUAJIT_TARGET=x86,
LUAJIT_DISABLE_JITandLUAJIT_SECURITY_PRNG=0; byte-for-byte reproducible.validate.creplaces the interpreter that buildvm generates as machine code (no WebAssembly
target):lj_vm_cpcallandlj_vm_unwind_cwithsetjmp/longjmp, throughlj_frame.h's
cframe_*macros;lj_vm_floorwithfloor(); the entry points that would run Lua code or
FFI calls stop the module with a message. It loads with mode"tX", which lays out frames in
two slots as EEex's x64 GC64 build does, and opens the FFI library once so that no finalizer
ever needs the interpreter.third_party/luajit/differential.mts(npm run luajit-differential, CI): builds a native
x64 LuaJIT from the same tree and fails if any chunk oftest/fixtures/luajit-syntax/or of
the generated limit cases (call arguments, nesting, locals, upvalues) gets a different answer.
- LuaJIT's lexical extensions in the server's own lexer (
src/server/syntax/lexer.ts) when
ieLua.runtime.luaisluajit, so hover, completion, semantic tokens, folding, document and
workspace symbols, definition, references, rename and formatting work on files that use them
(formatting refused such files as having syntax errors). Ported from the pinned LuaJIT tree:
numerals are read aslj_lex.clex_numberreads them and checked aslj_strscan_scandoes
withSTRSCAN_OPT_LL | STRSCAN_OPT_IMAG(isLuaJitNumber:LL/ULL/LLUon integers that
fit in 64 bits,ion any number,0bwith at most 64 binary digits, exponent and fraction
limits of 2^20);\u{X…}escapes followlex_string(below U+110000, no surrogates). Lua 5.2
lexing is unchanged. Names stay ASCII in both modes (LuaJIT also accepts bytes from 0x80 in
names).lex(source, from, to, runtime),ParseOptions.runtime,Chunk.runtime,
ParsedDocument.runtimeandparseDocument(text, kind, runtime); the formatter, rename and
completion lex again with the tree's runtime.ParsedDocumentCache.get(document, runtime)reuses a parse only for the same version and
runtime; features read the runtime per document first (src/server/features/openDocument.ts).
The workspace index parses files that are not open with their folder's runtime
(WorkspaceIndexDeps.analysisOptions) and re-indexes when it changes.test/unit/server/syntax/luajitDifferential.test.tscompares the parser with the LuaJIT
WebAssembly module ontest/fixtures/luajit-syntax/(except goto/label semantics), every
numeral of up to four characters, 64-bit and exponent limits,\u{…}boundaries and token
mutations of LuaJIT seeds. The mutation helper moved totest/unit/server/syntax/mutations.ts.
- Method syntax in hover, completion and semantic tokens (
src/server/hover/receiver.ts, through
memberTargetinsrc/server/hover/resolve.ts). A receiver is typed only when the code or a
LuaCATS annotation proves it; anything else gets nothing:- strings: a string literal (parenthesized or not), a local declared from one and never
assigned again (aliases followed), or a local or parameter annotated---@type string/
---@param x string.s:m()ands.marestring.m(manual §6.4; LuaJIT's lib_string.c
sets the same__index). Astring.mthe document defines is described by that definition. - tables: global paths (also through locals that alias them:
local w = worldScreen,
local str = string,local g = _G), locals declared from a table constructor and never
assigned again, fields of them, the implicitselfoffunction T:m()(asT), and values
annotated---@type Name/---@param x Namefor a---@class Nameattached to
local Name = …orName = …. Members are the library and EEex-Docs names as before, then the
functions the document stores in the table:function T:m(),function T.f(),
T.f = function, and{ f = function }in the constructor of a local. They are a new hover
target,member, rendered as(method) function T:m(a)/(field) function T.f(a)(labels
localized inl10n/server/) with the doc comment above the definition
(functionDocinsrc/server/docComments/attach.ts); hovering the name in the definition
shows the same. Semantic tokens type themmethodorfunction. - LuaJIT:
require("name")with a literal name, whenrequireis the global the document
never assigns, is the module the library documents (ffi,string.buffer); its documented
functions and methods that return a buffer object (returns, derived from the page's
buf = …headings) makebuffer.new()and chained calls typed. - Completion after
x:/x.on a local offers by the same types; a local of no provable type
still offers nothing. ---@classnames are now parsed (DocComment.className; still not rendered). Same document
only: definitions in other files are not followed (as for global hover). EEex game structures
(CGameSprite, …) are documented by EEex-Docs as types without members, so---@type CGameSpritegives no member documentation.
- strings: a string literal (parenthesized or not), a local declared from one and never
scripts/lua-manual/convert.mtsaccepts the LuaJIT documentation's HTML with
{ luajit: true }(</p>,<tt>,<i>,<br>, tables, links to other pages, the
external-link marker, colored code); the Lua 5.2 output is unchanged.
Changed
- The Emscripten version is pinned once, in
third_party/emscripten.mts, for both WebAssembly
builds; CI reads it from there (wasthird_party/lua52/build.mts). LuaChecker(src/server/validation/checker.ts) replacesLua52Checker; diagnostics take
checker(runtime)instead of a single Lua 5.2 checker.- New extension icon,
images/icon.png: a d20 (a regular icosahedron) in the previous navy and
gold palette, with a glowing "20" on the face toward the viewer. It is rendered by the rewritten
scripts/assets/icon.py(Cycles on the GPU, seeded, 512 → 128 px) using Blender's bundled Inter
font (OFL-1.1). The script now setsuse_nodesonly on Blender versions that need it, because
Blender 5.2 deprecates it. CONTRIBUTING.md › The extension icon documents how to regenerate it.
SHA-256 of ie-lua-language-server-1.2.0.vsix: ef843bb8c783fb98925cd4e4fb4cad90b2959e29aabe332dd6f37e6ac4ca0ca7
Installed size: 1650278 bytes (1.57MB in VS Code).