Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify style tags within the grammar #21

Open
wavejumper opened this issue Jan 23, 2023 · 1 comment
Open

Specify style tags within the grammar #21

wavejumper opened this issue Jan 23, 2023 · 1 comment

Comments

@wavejumper
Copy link

wavejumper commented Jan 23, 2023

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 :)

@wavejumper wavejumper changed the title Specify @external propSource within the grammar Specify style tags within the grammar Jan 23, 2023
@zampino
Copy link
Contributor

zampino commented Jan 30, 2023

Hi @wavejumper, yes I've recently seen this style in other grammars and it's probably worth to comply with it.

That said we also define highlight properties in @nextjournal/lang-clojure, which is a tiny package in the style of the official codemirror/lang-x languages. Using that, you won't need to pull the whole clojure-mode.

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

No branches or pull requests

2 participants