Skip to content

Route undefined binding diagnostics through WASM#37

Open
yenda wants to merge 3 commits into
juxt:mainfrom
yenda:refactor/wasm-undefined-binding-diagnostics
Open

Route undefined binding diagnostics through WASM#37
yenda wants to merge 3 commits into
juxt:mainfrom
yenda:refactor/wasm-undefined-binding-diagnostics

Conversation

@yenda

@yenda yenda commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose Rust semantic analysis from the WASM package via analyze(source)
  • route editor allium.rule.undefinedBinding findings through the Rust/WASM analyzer instead of the duplicated TypeScript text parser
  • remove the TypeScript rule-binding collector and map Rust byte spans to editor positions
  • move the remaining TS-only undefined-binding cases (exists candidate, for item in items) into the Rust analyzer
  • document in docs/project/rust-checker-parity.md that allium.rule.undefinedBinding is now a migrated Rust/WASM-owned diagnostic for editor/LSP surfaces

Rationale

The existing project docs describe the TypeScript/Rust analyzer split as a transitional state: TypeScript served the editor/LSP first, while Rust/WASM was introduced later as the parser-backed path. Keeping semantic diagnostics duplicated creates drift risk; this PR migrates one concrete diagnostic lane to the Rust implementation without broadening the scope to unrelated checks.

Stack

This is logically stacked on #36 (Fix typed trigger parameter bindings) to keep the original bug fix separate from the analyzer ownership change.

Because this branch comes from a fork and the stack base branch is not available in the upstream repository, this PR targets main. Until #36 merges, GitHub's aggregate diff includes the #36 commit; the intended review scope here is the two follow-up commits after Fix typed trigger parameter bindings.

After #36 merges, this PR can be rebased or retargeted so its diff contains only the WASM migration commits.

Verification

  • cargo test --workspace
  • cargo fmt -p allium-wasm --check
  • wasm-pack build crates/allium-wasm --target nodejs --out-dir ../../packages/allium-parser-wasm
  • npm run lint (exits 0; reports existing warnings in generated ignored WASM .d.ts files)
  • npm run test
  • git diff --check

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.

1 participant