Skip to content

test: import syntax from the library in the tokenizer partition test - #6949

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6948
Nov 24, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-6948

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#6932 moved syntax colouring out of the package API into the library (browser/runtime/lib/syntax-tokens.js, listed as a public kernel entry in kernel-registry.json), but test_shell_commands_share_colors_in_plain_code_widgets_and_diffs still read syntax from window.__lfWidgetApi(). Every call threw TypeError: syntax is not a function, so ci on main went red (run 45313963639, the only failure among 7,916 tests). The test changed nothing else about what it checks: in every language the registry lists, the tokens must add up to the exact source. Browser tests don't run on pull requests unless the PR edits them, so #6932 merged green.

The render harness now exposes window.__lfLibImport(name) next to __lfVendorImport. It resolves against the same compiled entry base, and the test's two direct syntax calls import through it. No other test pulls one of the ten names #6932 moved (syntax, syntaxNow, synNodes, codeLanguage, ensureSyntaxLanguage, tokenLines, actionTemplate, iconTemplate, tally, tallyWords) from the package API.

Verification: on main at 4660b588e the test fails by node id; with this change it passes.

Closes #6948 — automated triage

#6932 moved syntax colouring out of the package API into
runtime/lib/syntax-tokens.js, a public kernel entry, but
test_shell_commands_share_colors_in_plain_code_widgets_and_diffs still
read `syntax` from window.__lfWidgetApi(), so every call threw
"syntax is not a function". The render harness now exposes
window.__lfLibImport beside __lfVendorImport, and the test's two
direct calls import `syntax` through it. The behavior the test protects
(tokens partition the source exactly in every registered language) is
unchanged.

Closes #6948
@leaf-agent
leaf-agent merged commit 71db1e4 into main Nov 24, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6948 branch November 24, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci failing on main (push)

1 participant