Lezer Sandbox #12

Closed
opened 2021-11-13 15:22:35 +01:00 by ashtonsix · 3 comments
ashtonsix commented 2021-11-13 15:22:35 +01:00 (Migrated from github.com)

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
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](https://github.com/ashtonsix/lezer-sandbox) Live Demo: [lezer-sandbox.vercel.app](https://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
marijnh commented 2021-11-14 16:38:55 +01:00 (Migrated from github.com)

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.

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.
ashtonsix commented 2021-11-23 11:44:19 +01:00 (Migrated from github.com)

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.

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.
marijnh commented 2021-12-01 09:56:02 +01:00 (Migrated from github.com)

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

Nice, I've added a link to the website.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/website#12
No description provided.