Repository navigation
feat: add workspace symbols and engine-exact .menu handling - #5
Merged
Merged
Conversation
The .menu scanner splits text into lines and words with its own rules,
which differ from the engine. Add a lexer that follows the IESDP
description of the engine's lexer (menu_v1.htm, commit 38e7532; checked
against BGEE, BG2EE and IWDEE 2.6.6.0 and 2.7.3.0):
- `"…"` and `'…'` are the same kind of string: no escapes, may span
lines, and an unterminated one runs to the end of the file;
- a word is a run of ASCII letters and digits not starting with a digit;
`_`, `.` and other characters are skipped, so `My_Menu` is `My` then
the keyword `menu`;
- a word that is not one of the 122 keywords (matched case-insensitively)
is a string token;
- `--` comments, `{`, `}`, `-` and numbers;
- `` `…` `` inline Lua produces no token and is returned separately.
menuKeywords.ts holds the engine's keyword table verbatim. Nothing uses
the lexer yet; the extractor moves onto it in the next commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The extractor took a property from the first word of the current or
previous line and only knew part of the engine's rules, so it missed
Lua the engine compiles. It now works on the tokens of the new lexer and
on the IESDP list of properties whose STRING is Lua ("How a menu becomes
Lua", menu_v1.htm, commit 38e7532):
- statements: onopen, onclose, action, actionalt, actiondbl,
actionenter, actionexit, actionUpdate, actionsimpledrag,
actionsimpledrop, actionHold, actionScroll;
- expressions: enabled, actiondrag, table, seperator, useOverlayTint,
`bitmap res` and every `lua STRING` value.
A STRING is `"…"`, `'…'` or an unquoted word that is not a keyword, and
the property is the token just before it, wherever it sits on the line.
Block keywords are the keyword just before `{`, and a block's name is the
STRING after its first `name` keyword.
Effect on the game's UI.MENU (local check, nothing copied): the 3,109
chunks found before are all still found, at the same offsets and with the
same text, plus 191 new ones:
- 56 `bitmap res "…"`;
- 65 `table`, 5 `seperator` and 4 `useOverlayTint` values;
- 52 single-quoted values (51 `lua '…'`, 1 `enabled '…'`);
- 5 unquoted words (`table characterDetails`, `enabled currentSave`, …);
- 4 `clickable lua` values whose `"` is on the line after `lua`.
The 11 `actionDrag` scripts are now expressions, as the engine compiles
them, instead of statements. 92 one-line `button { name "…" … }` blocks
now get their name. All other blocks are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IESDP ("How a menu becomes Lua", menu_v1.htm, commit 38e7532) gives the
exact text the engine compiles for each property string:
function <prefix><address> () <code> end -- statement form
function <prefix><address> () return <code> end -- expression form
and says the lexer drops the last character before a closing backtick.
We compiled property code as a top-level chunk (with `return ` in front
of expressions) and backtick blocks in full, so we accepted code the
engine rejects:
- `...` in property code (the generated function is not vararg);
- a `--` comment on the last line, which comments out the `end`;
- `` `x = 1` ``, which the engine runs as `x = `;
- statements after an expression (`enabled "a return b"`).
- LuaChunk gains `forms` (prefix and suffix, without line breaks, so
compiler lines are still chunk lines) and `region` (the document range
with delimiters). The engine's function name is `f`, since any name
gives the same syntax.
- validateChunk compiles every form and reports the first failure. A
`near '<token>'` that is unique on the compiled line and lies in the
added text maps to an empty range at the edge of the chunk.
- Backtick chunks are the text the engine runs, without the last
character.
- parser: new `functionBody` option, used for property chunks: `...` is
rejected and statements start one level deeper, as inside the
generated `function` statement. The differential test now also checks
the parser against the compiler on the wrapped forms, including the
nesting limit (198 parentheses in an expression, 200 `do` blocks).
- parser: the implied `return` of `expression` mode now counts as a
statement level, like lparser.c `statement`. Before, 199 nested
parentheses were accepted while `return` + 199 is rejected.
- folding: the fold of a chunk's delimiters uses `region`, since the
text of a backtick block no longer reaches the closing backtick.
The game's UI.MENU (local check) still gives 0 diagnostics, across all
3,300 chunks. Validating it takes 25.9 ms (median of 15) instead of 23.2 ms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These three slot properties are shorthands: the engine pastes their STRING T into generated properties (IESDP, menu_v1.htm commit 38e7532, Item properties › Slots), for example `icon lua "T.item.icon"`, `action = expression Infinity_SwapSlot(T.id)` and `actionalt = statement showSpellDetails(T, false)`. They were not recognized at all. Their STRING is now an expression chunk whose `forms` are the generated Lua, verbatim from IESDP: 10 forms for slotinfo, 6 each for spellInfo and memorizedSpellInfo (`bam lua "'IVSLOT'"` does not contain T and is left out). Validation reports the first form that fails, so `slotinfo "1"` is rejected (`return 1.item.icon` is not Lua) although `1` is a valid expression. The names in T (`characters`, `id`, …) now take part in navigation like any other expression. UI.MENU (local check): 136 more chunks (3,436), still 0 diagnostics. Validating it takes 31.2 ms (median of 15), within the 50 ms budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IESDP (menu_v1.htm, commit 38e7532) describes three ways the engine reads a .menu file differently from how it looks. Each now has a diagnostic with a stable code: - menu-inline-lua-last-character (warning): "The engine drops the last character before the closing backtick". The range is that character, when it is not white space. - menu-word-too-long (error): "A word of 64 or more characters makes the engine abort". Quoted strings are not limited. - menu-unquoted-underscore (warning): `_` is not part of a word, so unquoted `My_Menu` is the string `My` followed by the keyword `menu`. Reported once per run of letters, digits and `_`, naming the parts the engine reads, with the quoted form as the fix. `menu-unterminated-string` now also covers `'` strings, which the engine treats like `"` strings, and names the missing quote. Problem gains `severity`; features/diagnostics.ts maps it to the LSP severity, and every existing problem stays an error. The game's UI.MENU (local check): none of the three fires; still 0 diagnostics. New fixture MISREAD.MENU and an integration test check a warning and an error that only the engine's compile form produces (`...` in an action), on VS Code 1.91.0 and 1.144.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The grammar embedded Lua only after action*/onOpen/onClose/enabled at the start of a line, or after `lua`, and only in `"…"` strings; it marked as elements only the item types found in UI.MENU (`slot` was missing) and any first word of a line as a property. It now follows the extractor: - Lua after every statement and expression property, the slot shorthands, `bitmap res` and `lua`, anywhere on a line, in `"…"` and `'…'` strings, with comments allowed in between; - the engine's 122 keywords (case-insensitive) as properties, and the item types plus menu/column as elements when a block follows; - numbers as the engine reads them (runs of digits). TextMate matches regular expressions, not the engine's tokens, so unquoted Lua words (`table characterDetails`) are not highlighted as Lua; the grammar's comment says so. A new unit test checks the keyword, element and Lua property lists against menuKeywords.ts and menuExtractor.ts (whose property sets are now exported for it). Checked by tokenizing sample lines with vscode-textmate 9.2.0 and vscode-oniguruma 2.0.1, installed outside the repository, using VS Code 1.144.0's own Lua grammar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CLAUDE.md now points to the IESDP MENU format and Engine Lua globals pages as the source for engine behaviour, and records that the engine's Lua state opens only _G, table, string, bit32, math and debug, replaces print, and has io, os and package only as test-automation stubs (lua_globals.htm, commit 38e7532). This matches plan.md's help-text scope and is a constraint for hover and completion. No code change: these libraries do not affect syntax, and the embedded compiler's LUA_COMPAT_ALL changes only library functions, so the diagnostics stay the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Workspace symbols will scan the workspace folders and skip what the
user's `files.exclude` hides. No new dependency: glob.ts and
filesExclude.ts are an original implementation of the semantics VS Code
gives that setting, read from its source at tags 1.91.0 and 1.144.0
(same behaviour at both):
- glob.ts follows `parseRegExp` in src/vs/base/common/glob.ts: `**`
segments, `*`, `?`, `{a,b}` (non-nesting, choices are patterns),
`[…]` with ranges and `!`/`^` negation, `/` or `\` as separators in
the matched path, case-sensitive, and the same handling of malformed
patterns (unterminated `{`/`[`, stray `}` and `]`).
- filesExclude.ts follows the explorer's FilesFilter
(explorerViewer.ts): patterns are matched against the path relative
to the workspace folder; `false` disables a pattern; `{ when }` needs
the sibling named by `when`, with the first `$(basename)` replaced by
the name without its extension; any other value enables the pattern.
Verified locally against VS Code's own glob.ts (1.144.0, bundled with
esbuild in a scratch directory, not committed): 0 mismatches in
2,412,400 pattern/path checks (6,031 generated and hand-picked
patterns, 49,107 matches), 0 mismatches in 735 files.exclude
expression checks with sibling clauses, and the new unit tests pass
unchanged against VS Code's implementation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WorkspaceIndex keeps, for every *.lua and *.menu file (any letter case, as documentKind recognizes them) under the `file:` workspace folders, a value computed from its text: the outline, for workspace symbols. - Scans walk each folder depth first and skip what files.exclude hides (read per folder, matched relative to it with real sibling listings for `when` clauses). Excluded folders are not entered, and neither are symbolic links to folders, so links cannot loop; links to files are read. - Files are read one per macrotask (an injected yield), so a large workspace never blocks the server; UI.MENU takes ~25 ms to parse, under the 50 ms rule. - Text is decoded as UTF-8 with the BOM removed and invalid bytes replaced, as VS Code opens files by default. - Files are keyed by native path, with a Windows drive letter in lower case, so a disk entry and an open document match whatever the URI spelling. URIs are the folder's URI plus percent-encoded segments. - Updates: fileChanged (created, changed, or closed in the editor: re-read, if still in a folder and not excluded, checking each parent folder against files.exclude; a created folder has its files indexed), fileDeleted (the file or everything under a deleted folder), setFolders, and settingsChanged, which re-reads files.exclude and rescans only if it changed, since clients notify every settings change. A newer scan stops an older one. Work runs in order on one queue; ready() resolves when the work queued so far is done, including the work it queues itself. - Non-`file:` folders (virtual workspaces) are logged and skipped. Everything is injected (file system, path functions, analysis, files.exclude lookup, yield, log), so the tests use an in-memory file system. The server wiring comes with workspace symbols. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
workspace/symbol ("Go to Symbol in Workspace") over the workspace index
and the open documents.
- features/workspaceSymbols.ts: the index keeps the flat outline of each
file (fileSymbols: the existing documentSymbols, through the flat
conversion now extracted from toLspSymbols as flatSymbols). Results
are the open documents' symbols (from the parse cache, so unsaved text
wins) and those of indexed files that are not open, matched by key.
The handler first waits for queued indexing, and stops on
cancellation, both while waiting and while collecting.
- syntax/workspaceSymbols.ts: matchesQuery follows the LSP 3.17 rule of
thumb: the query's characters in order, case-insensitively; an empty
query matches everything.
- server.ts:
- creates the index with the Node file system adapter
(workspace/nodeFileSystem.ts; readdir withFileTypes reports links
without following them);
- reads files.exclude per folder via workspace/configuration;
- yields with setImmediate;
- starts scanning on `initialized`, since requests to the client are
not allowed before it;
- registers watchers when the client supports dynamic registration:
`**/*.[lL][uU][aA]`, `**/*.[mM][eE][nN][uU]` (LSP globs are
case-sensitive), and `**/*` for creates and deletes only (folders);
- follows workspace folder changes when supported, with the
`workspaceFolders` server capability;
- re-reads a file from disk when its document closes.
- The connection keeps one didChangeConfiguration handler, so
diagnostics.register now returns its handler and server.ts calls it,
then index.settingsChanged().
- Clients that don't send workspaceFolders get open documents only; the
deprecated rootUri is not used.
Integration tests on VS Code 1.91.0 and 1.144.0 (29 passing, 6 new):
- a never-opened file;
- a .MENU file's menu and Lua symbols;
- loose matching;
- unsaved edits, and their removal when the document is closed without
saving;
- .lua and .MENU files created and deleted through workspace.fs, which
shows the `[]` watcher globs work;
- files.exclude, set and restored at run time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Until now the extension activated only when a Lua or ie-menu document was opened, so Go to Symbol in Workspace found nothing before then. Add `workspaceContains:**/*.[lL][uU][aA]` and `workspaceContains:**/*.[mM][eE][nN][uU]`: any letter case, the same rule as the index and its file watchers. CLAUDE.md allows explicit `workspaceContains` events when needed; `onLanguage:lua` stays. Manifest change: the extension now also starts in folders that hold such files without one being opened. Verified with a one-off test on VS Code 1.144.0 (not committed; it needs workspaces of its own), which never calls activate() and has no editor open: - a workspace holding only `deep/ONLY.MENU` activates, and its symbol is served; - so does one holding only `Script.LUA`; - control: with the previous manifest, the `.MENU` workspace never activates (20 s timeout). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: workspace symbols in the note and the feature list; the .menu bullet now says what is checked (every Lua the game compiles, in the form it compiles it, including slotinfo/spellInfo) and that warnings flag text the game misreads, with a link to the IESDP format page. - docs/editors/README.md: the workspace/symbol row, a note on the menu warnings, and what the feature needs from an editor (workspace folders; dynamic watched-file registration; files.exclude through workspace/configuration, with an example for editors that pass settings that way; local folders only). - CLAUDE.md purpose line and layout, CONTRIBUTING layout: src/server/workspace/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by measuring on the game's UI.MENU: the new lexer made extraction of the Lua in a .menu file twice as slow as the scanner it replaced (11.5 ms vs 5.6 ms, medians). Lexing took 7.9 ms of that, for 35,836 tokens, because isLetter/isDigit ran a regular expression on every character and comments were skipped one character at a time. Letters and digits are now classified by comparing characters, and a comment ends at the next line break found by a sticky search. Lexing takes 2.5 ms and extraction 3.3 ms, faster than before this branch. Same output: the optimized lexer gives deep-equal results to the previous commit's on UI.MENU and on 20,000 random inputs (letters, digits, `_`, quotes, backticks, braces, comments, CR/LF, VT/FF and non-ASCII characters); local check, not committed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e events Findings of the project /review on this branch: - `ready()` waited until the queue was empty, including work queued after the call, so a steady stream of file events (a build writing .lua files) could hold a Go to Symbol in Workspace request until it was cancelled. It now waits for the work queued before the call. The one case that relied on the old loop, the rescan that a files.exclude change triggers, now runs inside the settingsChanged job itself. - Re-reading a changed file removed its entry first, so the file dropped out of results while it was read. The previous entry now stays until the new one is ready, and is removed only when the file is excluded or cannot be read. - A file that is gone (ENOENT: deleted meanwhile, a closed document whose file was deleted, a dangling link) is no longer logged as a read failure; other read errors still are. New tests: - a request returns while later work never completes; - the files.exclude rescan is still waited for; - no log for a vanished file, while EACCES is still logged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Finding of the project /review: CI runs on Linux only, so the workspace index's Windows handling (`\` separators in relative paths and folder prefixes, lower-case drive letters in keys, URIs built from a `file:///c%3A/…` folder) was never exercised. The in-memory file system now takes a separator, and a new test runs the index with `path.win32`. It checks: - a folder URI as VS Code spells it (`file:///c%3A/Mods`); - a segment with a space, percent-encoded in the URI; - files.exclude matched against `/`-separated relative paths; - an open-document URI with an upper-case drive letter, which maps to the same key; - deleting a folder, which drops the files under it. It runs on Linux, so it costs no extra CI minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nits from the project /review on this branch: - New unit test for workspace/nodeFileSystem.ts on a temporary directory: files, directories and symbolic links (to a folder and to a file) are reported without following links; reading follows a link; a missing file rejects with ENOENT, which the index relies on. - menuExtractor.ts says why its property tables are exported (the grammar test checks the TextMate grammar against them). - waitForWorkspaceSymbols yields one setImmediate between attempts instead of re-sending the request in a tight loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
CI timing review, first push (
No job is anywhere near 2× its baseline, so there is nothing to investigate.
🤖 Generated with Claude Code |
This was referenced Oct 29, 2026
4Luke4
added a commit
that referenced
this pull request
Nov 5, 2026
* build(deps-dev): bump @azure/msal-node to 7.2.0 via @azure/identity Fixes Dependabot alert #5, GHSA-xcx6-jx8p-x3h5 / CVE-2026-109461 (high): MSAL Node authorization code flow may disclose parameters to an attacker-controlled endpoint. Affected: >= 5.0.0-beta.0, < 7.1.0. Path: @vscode/vsce@4.1.0 -> @azure/identity@4.14.0 -> @azure/msal-node@6.0.1 (development only; used by `vsce` for Azure sign-in, never bundled). @azure/identity 4.14.1 depends on @azure/msal-node ^7.1.0 and is inside the ^4.13.2 range @vscode/vsce already declares, so `npm update @azure/identity` fixes it without a manifest change. Lockfile changes: @azure/identity 4.14.0 -> 4.14.1, @azure/msal-node 6.0.1 -> 7.2.0, @azure/msal-common 16.14.1 -> 16.16.0. No new packages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * build(deps-dev): override serialize-javascript for @vscode/test-cli Resolves the Dependabot alerts for serialize-javascript 6.0.2: - alert 2, GHSA-5c6j-r48x-rmvq (high): RCE via RegExp.flags and Date.prototype.toISOString(); affected <= 7.0.2 - alert 3, GHSA-qj8w-gfj5-8c6v / CVE-2026-34043 (medium): CPU exhaustion via crafted array-like objects; affected >= 5.0.0, < 7.0.5 - alert 4, GHSA-m5mm-p8h7-m29v / CVE-2026-115897 (low): XSS via unescaped </script in a serialized function body; affected < 7.1.3 Path: @vscode/test-cli@0.0.15 -> mocha@11.8.0 -> serialize-javascript@6.0.2 (development only; never bundled). No upstream fix is available: @vscode/test-cli 0.0.15 is the latest release and requires mocha ^11.7.6, and every mocha 11.x (latest 11.8.0) requires serialize-javascript ^6.0.2. A scoped `overrides` entry is therefore the only fix; it is limited to the @vscode/test-cli subtree. Compatibility: the project's own mocha 12.0.3 already runs on serialize-javascript 7.1.4 through the same CommonJS `require("serialize-javascript")` call in lib/nodejs/buffered-worker-pool, and mocha only loads that module in --parallel mode, which neither .mocharc.json nor .vscode-test.mjs enables. serialize-javascript 7.1.4 needs Node.js >= 20; the project requires >= 24. Lockfile: the nested serialize-javascript@6.0.2 and its only dependency randombytes@2.1.0 are removed (7.1.4 is deduplicated with mocha 12's copy). Re-resolving the @vscode/test-cli subtree also moved its own dependency enhanced-resolve 5.26.0 -> 5.26.1 (patch, used only by @vscode/test-cli). CONTRIBUTING.md records why the override exists and when to remove it (once @vscode/test-cli depends on mocha >= 12). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(scripts): validate EEex docs data and remove file race in sync Addresses the CodeQL alerts on scripts/eeex-docs/sync.mts: - js/file-system-race (alert 1, high): main() checked existsSync(file) and then read and later wrote the same path. The new readRecorded() reads directly and treats only ENOENT as "no data file yet"; any other error is rethrown. existsSync is no longer imported. - js/http-to-file-access (alert 3, medium): writing fetched data to data/eeex/<section>.json is the script's purpose, so the data is now validated before it is used or written: - the Read the Docs build commit and the GitHub source commit must be full 40-character lowercase SHAs (isCommitSha). The build commit is interpolated into a GitHub API URL, and both are written to $GITHUB_OUTPUT, where an embedded newline could have injected step outputs. - every entry must pass isSafeEntry: a Lua-style identifier name and a URL inside DOCS_BASE whose remainder is only RFC 3986 unreserved characters, percent-encoded octets, `/` and a single `#`, with no `.` or `..` segments. The URL is rendered as a hover link by src/server/hover/, so characters that could end a Markdown link or start markup are rejected. On failure the script stops with an ::error annotation that names the offending values (up to 10 entries) and writes nothing. Both validators live in inventory.mts (pure) and are unit-tested, including a test that the committed data/eeex/*.json files satisfy them. Checked against the live upstream: all 1911 entries in the three sections pass and are identical to the committed data, and `sync.mts <section> --check` reports no change for each section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(changelog): record the security fixes Adds a "Security" section under [Unreleased] in CHANGELOG.md for the dependency updates and the EEex docs sync hardening in this branch. docs/CHANGELOG.vsix.md is unchanged: CONTRIBUTING.md › Changelogs reserves both files for user-visible changes, and only development tooling changed; the shipped bundles are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The next step from
plan.mdafter #4: workspace symbols (Go to Symbol in Workspace,workspace/symbol). #4 said workspace-wide results would come with it.The PR also brings the
.menusupport in line with the engine, using what IESDP documents about the format. The IESDP pages were checked against the executables of BGEE, BG2EE and IWDEE 2.6.6.0 and 2.7.3.0. Every fact is cited in the code with the page and the IESDP commit (38e7532).Decisions taken with the maintainer before implementation:
.menuchecks_in unquoted text, andslotinfo/spellInfo/memorizedSpellInfofiles.exclude, applied as VS Code's explorer applies it, with a built-in matcher (no new dependency)workspaceContains, so Ctrl+T works before a file is opened (manifest change, see commit 11)What IESDP showed the old
.menucode got wrongCounts are from the game's own
UI.MENU, run locally. It is gitignored, and nothing from it is copied.'…'and"…"are the same kind of string'…'was never Luatable characterDetails,enabled currentSaveand 3 more missed, so navigation missed those namestable,seperator,useOverlayTint,bitmap resare expressions;actiondragis an expressionenabledandluacounted as expressions;actiondragwas treated as statementsbutton { name "…" … }blocks had no name; 4clickable luavalues were missed (luaand"on different lines)function <p><addr> () <code> end, or withreturn <code>for expressions...and a trailing--comment (which swallows theend) were wrongly accepted`x = 1`runs asx =in the gameslotinfo/spellInfo/memorizedSpellInfoSTRINGs are pasted into generated Lua_G,table,string,bit32,math,debug(io,os,packageare test-automation stubs)Commits (one concern each; review them one by one)
feat(server): lex .menu files as the engine doesmenuLexer.tsfollows IESDP's lexical rules.menuKeywords.tsis the engine's 122-keyword table, verbatim.fix(server): find all the Lua in .menu filesfix(server): validate .menu Lua in the form the engine compilesLuaChunk.formsholds the text compiled around the code, andregionthe chunk's range with its delimiters. Errors in the added text map to the edge of the chunk. Parser optionfunctionBody: no..., and one level deeper. Also fixes a pre-existing off-by-one inexpressionmode's nesting limit (199 parentheses were accepted).feat(server): validate slotinfo, spellInfo and memorizedSpellInfofeat(server): report .menu text the engine misreadsmenu-inline-lua-last-character(warning),menu-word-too-long(error),menu-unquoted-underscore(warning).menu-unterminated-stringnow also covers'.Problem.severityis new.fix: highlight all the Lua in .menu filesdocs: record where engine facts come from and the engine's Lua librariesfeat(server): add a glob matcher for files.excludefiles.excludesemantics, read from its source at 1.91.0 and 1.144.0 (see testing below).feat(server): index the Lua and .menu files of the workspaceWorkspaceIndex: background scan, one file per macrotask. It honorsfiles.exclude, never follows links to folders, and updates on file events, folder changes and settings changes. The file system is injected.feat(server): add workspace symbolsdidChangeConfigurationhandler. Open documents win over their saved version.feat: activate when the workspace contains Lua or .menu filesworkspaceContains:**/*.[lL][uU][aA]andworkspaceContains:**/*.[mM][eE][nN][uU]. No command or setting was renamed.docs: document workspace symbols and the engine-exact .menu checksperf(server): lex .menu files without a regular expression per characterfix(server): keep workspace symbol requests from waiting on later file events/reviewfinding (below).test(server): check the workspace index with Windows paths/reviewfinding: CI is Linux-only.test: cover the Node file system adapter and tidy review nits/reviewnits.Changelog entries (
CHANGELOG.mdanddocs/CHANGELOG.vsix.md) were added in the commits that make each change. Nothing has been released yet, so the existing[Unreleased].menuentry was corrected rather than adding a "Fixed" entry for unreleased behaviour.Project
/reviewfindings and what was doneready()waited for work queued after the call, so a stream of file events could hold a request upfile:///c%3A/…) not exercisedpath.win32readdirto detect folders.menuand compiler messages; listed under limitationsHow it was tested
Locally (Linux/WSL2, Node 24.22.1):
check-types;lint(0 warnings);test:unit(272 passing, up from 186);check-l10n.package, thennotices -- --check, thenvsce package+vsce ls. The VSIX allow-list is unchanged.npm test: 29 passing on both VS Code 1.91.0 and 1.144.0 (7 new)..MENUfile's menu and Lua symbols;.luaand.MENUfiles created and deleted outside the editor, which shows the[]watcher globs work;files.excludeset and restored at run time....in an action)..menuchanges on the game's UI.MENU (local only):Parser vs. the official compiler on the new forms:
functionBodymode with the compiler on the wrapped text: corpus, seeds, 1,600 mutations, and the nesting limit.return, and 200doblocks inside the function.Glob matcher vs. VS Code's own
glob.ts(1.144.0 sparse clone, bundled with esbuild in a scratch directory, not committed):files.excludeexpression checks, includingwhenclauses.TextMate grammar: tokenized sample lines with
vscode-textmate9.2.0 +vscode-oniguruma2.0.1, installed outside the repo, and VS Code 1.144.0's Lua grammar.Activation: a one-off test (it needs workspaces of its own) on VS Code 1.144.0. It never calls
activate()and has no editor open.deep/ONLY.MENUactivates and serves its symbol.Script.LUA..MENUworkspace never activates (20 s timeout).Timings on UI.MENU (medians of 15 runs; same machine, measured against a
mainworktree):main""/"infpush")Everything stays under the ~50 ms event-loop budget from
.claude/rules/language-server.md, and the index yields between files.Bundle size:
CI baseline (#4's last run, for the timing review in the comments): checks 25 s, integration minimum 33 s, integration stable 37 s, WASM reproducibility 29 s, CodeQL JS/TS 60 s, CodeQL actions 40 s, commitlint 18 s.
Known limitations
vscode-vfs:and the like) get their open documents only.rootUriis not used) get open documents only.files.excludeonly.search.excludeand.gitignoreare not applied, as in VS Code's explorer by default. A nested workspace folder is also scanned under the rules of the folder that contains it..menugrammar (itsInvalid token in menumessages, from the Lemon parser) are not reported yet. Only lexical problems and Lua errors are..menudiagnostic messages are English, like the existing.menuand compiler messages.table characterDetails), though they are checked. TextMate cannot follow the engine's tokens.path.win32, but not on a real Windows file system.Checklist
npm run check-types,npm run lintandnpm run test:unitpassnpm test(integration) passes, if activation, commands, settings or the LSP wiring changedvscode.l10n.t()/package.nls.json, andnpm run check-l10npasses (no new client strings; server diagnostics are English, as before)CHANGELOG.mdanddocs/CHANGELOG.vsix.mdhave entries under[Unreleased](if users notice the change)🤖 Generated with Claude Code