Skip to content

v1.0.0

Choose a tag to compare

@4Luke4 4Luke4 released this 05 Nov 12:08
cbdef49

Added

  • Language server (separate Node process; IPC in VS Code, --stdio for other editors) with
    syntax diagnostics from the official Lua 5.2.4 compiler, built to WebAssembly from the
    checksum-verified lua.org tarball (third_party/lua52/, reproducible build checked in CI).
  • .menu support: new ie-menu language (case-insensitive .menu extension), TextMate grammar
    that highlights the engine's keywords and embeds Lua where validation finds it, and validation of the Lua the engine compiles, found with a lexer
    that follows the engine's (per IESDP):
    `…` blocks; onOpen, onClose and action* scripts; and the expressions of enabled,
    actionDrag, table, seperator, useOverlayTint, bitmap res and every lua value. A value
    can be "…", '…' or an unquoted word that is not a keyword, anywhere on a line. Each is
    compiled in the shape the engine compiles it: property code as the body of
    function f () … end (so ... and a trailing -- comment are errors), expressions as its
    return value, and `…` blocks without their last character, which the engine drops.
    slotinfo, spellInfo and memorizedSpellInfo strings are checked in every expression and
    statement the engine generates from them (T.item.icon, Infinity_SwapSlot(T.id), …).
  • .menu diagnostics for text the engine misreads (codes are stable): menu-unterminated-string
    for " and ' strings, menu-unterminated-block, and the new menu-word-too-long (error: an
    unquoted word of 64 or more characters aborts the game), menu-inline-lua-last-character
    (warning: the character before a closing backtick is dropped) and menu-unquoted-underscore
    (warning: unquoted My_Menu is read as My and Menu).
  • Settings ieLua.validate.mode (manual, save (default), type, saveAndType) and
    ieLua.validate.debounce (default 300 ms).
  • Command IE Lua: Validate Current File (ieLua.validateDocument).
  • Document symbols (textDocument/documentSymbol; outline, breadcrumbs, Go to Symbol in
    Editor
    ): functions and methods at any depth, top-level locals, the first assignment to each
    global, and named table fields; in .menu files, each menu block by its name, holding the
    Lua symbols inside it. Flat SymbolInformation for clients without hierarchical support.
  • Folding ranges (textDocument/foldingRange): function bodies, do/while/for/repeat,
    each if/elseif/else clause, multi-line tables, call arguments and long strings, long
    comments and runs of -- lines; in .menu files every { … } block, `…` blocks and
    "…" scripts, plus the Lua inside them. The closing line stays visible. Honors the client's
    rangeLimit and supported kinds.
  • Go to definition (textDocument/definition): from any use of a local to its declaration, and
    from a global to every assignment to it (x = …, function x()), in the document and in
    every other .lua and .menu file of the workspace. The engine runs "in one global Lua state
    that is shared by the MENU file, the game's own Lua files and the engine"
    (IESDP), so a
    global is matched by name in every file; locals stay in their own chunk. No result for the
    implicit self, for globals no file assigns (game, EEex and library functions), or for table
    fields.
  • Find references (textDocument/references), with the same matching as go to definition: the
    uses of a local, including the implicit self of a method, or every use of a global in the
    document and in the other files. includeDeclaration decides whether the local's
    declaration, or the assignments to the global, are included.
  • Across files, for go to definition and find references: the other files are the open
    documents, whose unsaved text wins over the saved file, and the files of the workspace index
    (the files of workspace symbols, files.exclude honored). The document's own results come
    first, then the other files in URI order. A request waits for files still queued for
    indexing, and answers ContentModified (LSP 3.17) if the document changed meanwhile. _ENV,
    and names resolved through a local _ENV (fields of that table, Lua 5.2 manual §2.2), are not
    globals: they have no definition or references, in the document or elsewhere.
  • Rename (textDocument/prepareRename, textDocument/rename) within the document, for locals
    and for globals the document assigns. Refused, with a reason localized in VS Code: anything
    that is not a variable (including _ENV and names resolved through a local _ENV), the
    implicit self, globals the document never assigns (defined in another file, the game or
    EEex), code with syntax errors where the variable can occur, new names that are not Lua names
    or are reserved words, and any rename that would change what a name
    refers to, including moving a name into or out of a local _ENV (checked by re-analyzing the
    renamed text). Edits are versioned when the client
    supports documentChanges.
  • Workspace symbols (workspace/symbol; Go to Symbol in Workspace): the outline symbols of every
    .lua and .menu file (any letter case) in the file: workspace folders, and of every open
    document, whose unsaved text wins over the file. The query matches loosely (its characters in
    order, case-insensitively), as LSP recommends. Files are indexed in the background, one per
    event-loop turn, and kept current through watched-file events (**/*.[lL][uU][aA],
    **/*.[mM][eE][nN][uU], and creates and deletes of folders), workspace folder changes and
    document closes. files.exclude is honored as VS Code's explorer applies it, with an original
    matcher checked against VS Code's own; changing it rescans.
  • Hover (textDocument/hover), in Markdown or plain text as the client prefers:
    • Lua 5.2 library functions, values and module tables, with the text of the
      Lua 5.2 manual verbatim and a link to the entry:
      the basic functions and the string, table, math, bit32 and debug libraries, the ones
      the engine opens (IESDP), also as _G.string.format and ("x"):rep(). The text is generated
      from doc/manual.html of the checksum-verified Lua 5.2.4 tarball (npm run lua-manual, checked
      in CI) and is identical to the online manual's. io, os, package (require) and
      coroutine are not documented, as the engine does not provide them.
    • print: a note that the engine replaces it, linking IESDP's Engine Lua globals, instead of
      the manual's description.
    • EEex and game functions (EEex_*, Infinity_*, C:AddGold, also called as C.AddGold):
      the name and a link to EEex-Docs; no EEex-Docs text is copied.
    • Locals and globals of the document: how they are declared (local function f(a, b),
      (parameter) a, (for variable) i, (global) function G(x)), from the first assignment for
      a global, shared across the Lua chunks of a .menu file.
    • No library text for names a local shadows (local string = {}), globals or library members the
      document assigns itself (string = …, string.format = …, function string.trim()), or names
      resolved through a local _ENV.
    • The server's own labels are localized into the 14 VS Code display languages from the client's
      locale (InitializeParams.locale), in every editor.
  • Completion (textDocument/completion, completionItem/resolve; triggered by . and :), with
    the rules of hover so that a completed name hovers as offered:
    • Variables: the locals visible at the cursor (the innermost of each name, the implicit
      self included), then the globals the document assigns (in any Lua chunk of a .menu file),
      the Lua 5.2 library globals the engine opens, the EEex and game functions, and the keywords.
      Each name once, from the first of these that has it. While a local _ENV is visible, only
      locals and keywords. Keywords are the 22 reserved words (manual §3.1); in .menu expressions
      (enabled "…", …) only nil, false, true, function, not, and and or (§3.4).
    • Members of globals (_G. prefixes removed): after _G. the globals; after t. and t: the
      fields the document assigns on t; the manual's members of string, table, math,
      bit32 and debug, unless the document assigns the module table or defines that member;
      EEex-Docs names after the operator they are documented with (EEex_Options_Option.new,
      C:AddGold). After ("…"):, the string library (§6.4). Nothing after locals, calls or
      indexes (no type inference).
    • Nothing in comments, strings and numbers, outside the Lua of a .menu file, or where a name
      is declared (after local, function, for, goto, ::, in their name lists and in
      parameter lists). io, os, package (require) and coroutine are never offered.
    • Each item has the hover's code line as detail; the manual text or EEex-Docs link is added
      when the item is resolved, in Markdown or plain text as the client prefers
      (completionItem.documentationFormat). The edit range is the name around the cursor, sent
      once per list when the client supports itemDefaults.editRange, as an insert/replace edit
      when it supports insertReplaceSupport.
  • Semantic tokens (textDocument/semanticTokens/full, /full/delta and /range) for the names
    in the Lua of .lua and .menu files, classified by the rules of hover so that a name is
    colored as it hovers. Keywords, literals, comments and .menu syntax are left to the TextMate
    grammars.
    • Types (all standard): namespace, function, method, variable, parameter, property,
      label. Modifiers: declaration, modification, defaultLibrary, and global, declared
      in the manifest (contributes.semanticTokenModifiers) so that themes can style *.global.
      No TextMate fallback scope is contributed: there is no conventional scope for globals, and
      the predefined fallbacks of the token types still apply.
    • Locals: parameters and the implicit self are parameter; local function f, and a local
      declared with a function expression and never assigned again, are function.
    • Globals have global. A global the document assigns is a function or variable from its
      first assignment; otherwise it takes its kind from the Lua 5.2 manual (namespace for the
      module tables) or EEex-Docs. defaultLibrary marks the manual's names, the engine's print
      and the EE Game Lua Functions, not EEex functions. _ENV, and names resolved through a
      local _ENV, are not globals.
    • Fields are property, or method after :; library and EEex-Docs members (string.format,
      C:AddGold) as documented. Assignment targets have modification, declared names
      declaration, labels are label.
  • Formatting of .lua files (textDocument/formatting, /rangeFormatting and
    /onTypeFormatting), layout-preserving: only the white space between tokens and comments
    changes. .menu files are not formatted (no formatter is offered for them).
    • Line breaks are kept exactly as written; strings, long strings and long comments are never
      touched. Trailing white space is removed (also after a -- comment) and blank lines are
      emptied.
    • Indentation by the constructs open at the start of each line (function, do, then,
      else, repeat, (, [, {), counted once per line that opens them (f(function() indents
      its body once); a line that starts with end, until, else, elseif, ), ] or } is
      indented like the line that opened the construct; a line that continues a statement gets one
      more level. One level is a tab, or tabSize spaces with insertSpaces; a tabSize that is
      not an integer from 1 to 100 (the bounds of VS Code's editor.tabSize) is refused and logged.
    • Spacing within a line: one space around binary operators, = and keywords and after ,/;;
      none inside ()/[], around ./:, after unary -/# or before the parentheses of a call
      or function; { a } and {}; string and table call arguments (f"x", f{…}) stay joined or
      apart as written; the space before a trailing comment is kept.
    • insertFinalNewline and trimFinalNewlines are honored for document formatting when the
      client sends true. No new settings.
    • A file with a syntax error is not formatted (the reason is logged); range and on-type
      formatting only refuse errors before the end of the lines they change.
    • On-type: after a line break the finished line is formatted (a blank new line keeps the
      editor's indentation); after the last character of end, else, elseif, until, ),
      ] or } that starts a line, the line is re-indented. VS Code needs editor.formatOnType.
    • Every result is lexed again and must have the same tokens and comments, or nothing changes.
    • Registered dynamically for Lua documents only (language lua, or *.lua in any letter case)
      when the client supports it, so .menu files have no formatter; static otherwise.
  • Quick fixes (textDocument/codeAction) for three .menu diagnostics, with the remedy
    IESDP states:
    • menu-unquoted-underscore: Enclose in quotes (My_Menu → "My_Menu"; "Always quote
      names"). A run without a letter (10_0) gets no fix: it is not a name, and quoting would
      make a number a string.
    • menu-word-too-long: Enclose in quotes ("Quoted strings are not limited"); the whole run
      when the word is joined to _.
    • menu-inline-lua-last-character: Insert a space before the closing backtick ("end every
      inline block with a line break or a space"), so the engine drops the space instead of code.
    • Each fix is preferred (isPreferred) and linked to its diagnostic; when the file has several
      problems of the code, Fix all <code> problems fixes them together.
    • source.fixAll.ieLua applies every fix of the file, also from editor.codeActionsOnSave
      ({ "source.fixAll.ieLua": "explicit" }) and whether or not diagnostics were published
      (ieLua.validate.mode manual). The kind is stable: settings refer to it.
    • No fix for lua-syntax, menu-unterminated-string or menu-unterminated-block: where the
      text should end, or how to repair the Lua, would be a guess.
    • The current text is analyzed again for every request: a diagnostic from an older version of
      the file (published on save, before later edits) gets no fix rather than an edit in the wrong
      place. Every set of edits is checked by lexing the result: the remaining problems must be
      exactly those no fix touches, or nothing is offered (and an error is logged).
    • The fixes change the Lua the engine compiles, as intended: the character it dropped before
      the backtick now runs, and a quoted property value is compiled whole (enabled "My_Var" is
      My_Var, not My). The Lua is validated as usual afterwards; it may report an error the
      dropped or split text hid.
    • Titles are localized like the hover labels. Advertised only to clients that accept
      CodeAction literals (codeActionLiteralSupport).
  • LuaCATS doc comments (annotation reference) on the
    document's own code, in hover, completion and diagnostics. Types are shown as written; nothing checks or infers them.
    • A doc block is a run of --- comments, each alone on its line, on consecutive lines; it
      documents the statement that starts on the next line. A blank line detaches it, and ----
      banners and --- after code are not doc comments. The reference does not state this rule;
      its examples follow it. The same applies inside the Lua of .menu files.
    • Documented: local function f, local x = … (one name), function G() and G = … (one
      name), a global by the block above its first assignment, as its hover code line already is.
      Each parameter shows its own @param entry, also for function M.f(a), function M:m(a)
      and M.f = function(a) … end, whose names have no hover.
    • Rendered: the description (Markdown, one leading space removed from each line), then
      @param, @return, @type, @deprecated and @see in the order written, laid out as VS
      Code's own TypeScript hovers lay out JSDoc tags (*@param* `name` — text), with the type in
      a code span after the name. The other reference tags (@class, @field, @overload, …) and
      ---| lines are not rendered and never show up as description. Tags are ---@tag, as the
      reference writes them; --- @tag stays description text.
    • The code line of the hover, and the detail of a completion item, do not change.
    • Completion items of documented names carry the same text as their hover in documentation,
      sent with the list rather than on completionItem/resolve: the resolve request names no
      document, so a later lookup could read a newer version of it.
    • Diagnostics (warnings, published with the others under ieLua.validate.mode; codes are
      stable): doc-tag-malformed for ---@param without a name or type and ---@return or
      ---@type without a type, in any doc block; doc-param-unknown for a ---@param the
      documented function does not have (... needs a vararg function, self a method), checked
      only where the statement writes the function itself, never for a call result; and
      doc-param-duplicate for a parameter documented twice. Messages are localized like the hover
      labels.
  • Error-tolerant Lua 5.2 parser and scope analysis (src/server/syntax/), checked against the
    official compiler by a differential test; it publishes no diagnostics of its own.
  • Localization of the manifest, UI strings and the language server's hover labels into all 14 VS
    Code display languages (machine-produced; review welcome).
  • Setup guides for Sublime Text, Neovim, Emacs, JetBrains IDEs, Helix, Zed, Kate, Notepad++ and Geany.
  • EEex documentation index (data/eeex/): names and deep links only, synced from the published
    Read the Docs build.
  • Repository tooling: CI, CodeQL, commit linting, Dependabot with auto-merge, release automation,
    EEex docs sync, issue and pull request templates.

Changed

  • The extension also activates in workspaces that contain .lua or .menu files, in any letter
    case (workspaceContains:**/*.[lL][uU][aA], workspaceContains:**/*.[mM][eE][nN][uU]), so
    Go to Symbol in Workspace works before any file is opened.
  • Minimum VS Code version is 1.91.0 (required by vscode-languageclient 10 and later).
  • Versioning starts at 1.0.0: when no release exists yet, the Release workflow ships the
    committed VERSION as the first stable release (a pre-release before it would be 1.1.0).
  • The Release workflow publishes only for merged chore(release): … pull requests, not for any
    other push that changes VERSION.
  • The Release workflow records the installed size of each release for the README's install-size
    badge (.github/badges/install-size.json, a shields.io endpoint): the size VS Code shows in the
    extension's details, computed from the VSIX exactly as VS Code installs it
    (scripts/release/vsix.mts). CI checks it on release branches and the publish job against the
    VSIX it publishes; the exact byte count goes in the release notes.
  • GitHub releases have the VSIX as their only asset; its SHA-256 moved from a separate
    .vsix.sha256 file into the release notes, so the download count covers VSIX downloads only.
  • CI integration jobs build the tests before running them, and a test run that finds no tests now
    fails. Until now the CI integration jobs ran 0 tests and passed.

Security

Development tooling only; the extension's bundles are unchanged.

  • @azure/msal-node (used by @vscode/vsce through @azure/identity) is 7.2.0, fixing
    GHSA-xcx6-jx8p-x3h5.
  • serialize-javascript in @vscode/test-cli's mocha 11 is forced to 7.x with an npm override,
    fixing GHSA-5c6j-r48x-rmvq,
    GHSA-qj8w-gfj5-8c6v and
    GHSA-m5mm-p8h7-m29v. See CONTRIBUTING.md › Setup
    for when to remove it.
  • The EEex docs sync script (scripts/eeex-docs/sync.mts) validates everything it fetches
    before using it: commits must be full SHAs, and every entry must be an identifier with a deep
    link inside the EEex documentation. Otherwise it stops without writing. It also reads the
    existing data file without a separate existence check (CodeQL js/file-system-race).

SHA-256 of ie-lua-language-server-1.0.0.vsix: 6dfb73acf9b0cd0b788896731fb5810df345a5194080d819ed9df7b0769fa0bd

Installed size: 1275111 bytes (1.22MB in VS Code).