Skip to content

Conversation

@charlespwd
Copy link
Contributor

Summary

This PR integrates @ohm-js/wasm to enable browser-compatible Liquid parsing in the VSCode extension, building on the browser test infrastructure from #1070.

Changes

  • Prettier 3 upgrade: Updated from Prettier 2 to v3 across the monorepo
  • @ohm-js/wasm integration: Replaced Node-only ohm-js with @ohm-js/wasm v0.6.17
    • Uses createToAst pattern for grammar-to-AST compilation
    • Implements using keyword for proper resource management
    • Uses ifPresent helper for OptNode handling
  • Test expectation updates: Adjusted test assertions for @ohm-js/wasm error message format differences
  • skipLibCheck fix: Added skipLibCheck: true to vscode-extension tsconfig for @ohm-js/wasm type compatibility

Prior Art

Testing

Browser integration tests pass with the wasm-based parser. The using keyword ensures proper cleanup of wasm resources.

🤖 Generated with Claude Code

charlespwd and others added 7 commits February 3, 2026 10:55
Add foundational infrastructure for running browser-based e2e tests
for the VS Code extension using @anthropic/vscode-test-web.

Includes:
- Test dependencies (mocha, chai, vscode-test-web)
- Webpack configuration for test bundling
- TypeScript and ESLint configuration for test files
- Activation smoke test to verify extension loads in browser
- Debug delay support for test development

Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add watch mode for browser test development

Introduces infrastructure for developing browser tests with live reload:
- Add test:web:debug script that builds once and launches browser
- Configure webpack to output debug bundle to separate file
- Add dynamic test discovery to support single-file test runs

This enables a faster development loop: edit tests, refresh browser,
see results immediately without rebuilding.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* Add browser e2e test for Liquid object autocomplete

Tests that Liquid object completions (e.g., 'product') appear when
triggered inside {{ }} delimiters. This validates the end-to-end
autocomplete flow in the browser test environment.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

---------

Co-authored-by: Claude Opus 4.5 <[email protected]>
- Update root package.json to prettier ^3.0.0
- Add tsconfig paths mapping for Prettier 2 type compatibility
- Add webpack alias for browser builds to use prettier2
- Reformat TypeScript files with Prettier 3 style changes

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ohm-js/wasm v0.6.17 FailedMatchResult returns generic "Match failed at pos N"
messages instead of detailed syntax error information. getExpectedText() is
not yet implemented in the WASM version.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The @ohm-js/wasm package has TypeScript declaration inconsistencies
(experimental package). skipLibCheck bypasses these errors without
affecting type checking of our own code.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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