Specify style tags within the grammar

Open
#21 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
tooling

Research direction

Read the Lezer grammar and highlighting setup, using the linked lezer-json grammar and styleTags example as references. Determine how lezer-clojure can expose its style tags through the grammar, then verify that consumers can use them without depending on clojure-mode; the issue does not name repository files or tests.

Written by the indexing model from the issue text.

Description

Hi there,

First off, thanks everyone for your work on this excellent library!

Lezer added support for specifying default props within the grammar file using @external propSource.
As far as I understand this enables you to declare the syntax highlighting within the lezer grammar itself.

For example lezer-json defines an @external propSource linking to these styleTags.

It would be great if lezer-clojure did something similar. Right now you need to pull in the clojure-mode package to grab the style tags.

For our use case, nothing in clojure-mode is particularly applicable except for the style tags.

If this sounds like a reasonable request/contribution, I'd be happy to draft up a PR :)

Dominant language
JavaScript
Stars
27
Forks
5
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextjournal/lezer-clojure

All issues in nextjournal/lezer-clojure

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.