Skip to content

Conversation

@peconia
Copy link
Contributor

@peconia peconia commented Oct 1, 2025

This is a proof of concept PR, absolutely not ready to merge 😅

This adds web-tree-sitter library with python language .wasm to use a tree sitter to analyze any python code for errors, and show a "friendly" error message for some common issues. The wasm files are served from this server so had to edit webpack config slightly. We could get these from a CDN or somewhere else too, just for this demo it seemed simpler to serve them from the same project.

The benefit of tree sitter is that it is very fast, as it only evaluates the new code as you type rather than has to redo the whole thing. the negative is that parsing a clean looking error message is not that straightforward, and can be brittle.

error.highlight.demo.mp4

TODO:

  • make all the messages translatable and make them more helpful to learners
  • cover more error scenarios and improve which parts of code get highlighted
  • clean up vibe code 😂

@peconia peconia temporarily deployed to previews/1250/merge October 1, 2025 16:30 — with GitHub Actions Inactive
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.

2 participants