lezer-parser/website

Lezer Sandbox

Closed this issue · 3 comments

I made a Lezer Sandbox, would you like to have something like this in the documentation?

With it, one can load a Parser & LanguageSupport, modify them, rebuild them, and see how they work on some sample code.

Source Code: github.com/ashtonsix/lezer-sandbox
Live Demo: lezer-sandbox.vercel.app

Details:

  • Works with all 15 CodeMirror language packages I could find: Basic Example, CSS, C++, HTML, Java, JavaScript, JSON, Lezer, Markdown, PHP, Python, Rust, SQL, WebAssembly, XML
  • Doesn't include languages as dependencies, instead grabs the latest tagged version from Github, or from the main branch if no tagged versions are available (as is the case for the basic example)
  • Uses prebuilt files if they're available and the user has not modified the source
  • Building the grammar can take a few seconds, so the sandbox does this in a web worker, ensuring the UI remains responsive
  • Does caching on network requests and code transforms
  • Tested with the latest version of Chrome on Linux Desktop only
  • Uses React/NextJS, but only lightly coupled to it

Neat! I'm not really willing to maintain something like that as part of the website at the moment, but if you're planning to keep this running for a while I could add a link to it.

Just seeing your reply now, I'm glad you like it! :)

A link would be much-appreciated, I'm happy to maintain and keep this running for a while.

Nice, I've added a link to the website.