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

Integrate tree-sitter-cel for highlighting #14

Open
Alfus opened this issue Jun 30, 2023 · 4 comments
Open

Integrate tree-sitter-cel for highlighting #14

Alfus opened this issue Jun 30, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Alfus
Copy link
Contributor

Alfus commented Jun 30, 2023

Feature Description

Add tree-sitter based syntax highlighting

Additional Context

I created a tree-sitter grammar for cel: https://github.com/bufbuild/tree-sitter-cel with highlighting support. Would be cool to use it:
image

@Alfus Alfus added the enhancement New feature or request label Jun 30, 2023
@matheusfm
Copy link
Contributor

Hi @Alfus,
Thank you for the suggestion. Would really be nice to have a specific highlight for CEL.

Do you know any web code editor that supports tree-sitter grammar?

We're using ace that doesn't seem to support it.

@Alfus
Copy link
Contributor Author

Alfus commented Jul 6, 2023

I've look around a bit, and all I can find is the c highlighting library and the tree-sitter-web query interface. I believe, if you feed in the highlights query file, it should return a query that can capture the nodes with their label (which has all the source location info).

Ideally this could then be mapped to a collection of source location + ace scope that ace understands, but the ace documentation doesn't show a way to bypass the regex based system they are using :-/.

@monuelo
Copy link
Contributor

monuelo commented Sep 12, 2023

Hello @Alfus, it could be an alternative, but perhaps considering the effort needed, it would be better to create a syntax highlighter in ace, since we don't know for sure there's a way to bypass the regex based system. Thoughts?

FWIW, there is an open issue related to tree-sitter support into the Ace code editor. Despite its presence, it appears that this issue has not received much attention or activity from the community.

@Alfus
Copy link
Contributor Author

Alfus commented Sep 21, 2023

Reading that issue, it looks like it might actually be possible bypass the regex based highlighter and use tree-sitter; though, tree-sitter-web also uses wasm, to its a lot to pull in for just highlighting. I suspect this issue should wait for better tree-sitter support on both sides.

@knrc knrc mentioned this issue Aug 12, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants