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

Query Support #2

Open
Alex-Muirhead opened this issue Mar 28, 2023 · 7 comments
Open

Query Support #2

Alex-Muirhead opened this issue Mar 28, 2023 · 7 comments

Comments

@Alex-Muirhead
Copy link

This is more of a question than an issue, but do you intend on supporting Tree-Sitter queries in the near future? I couldn't see any mention of it in the README, however I'm aware this is a young project.

I haven't worked on a tree-sitter grammar before, but I'd be happy to try and help if there's basic grunt work to do.

@SeniorMars
Copy link
Owner

SeniorMars commented Mar 28, 2023

Yes! I plan to implement all possible features within neovim especially conceal!

I'm moving at a slow pace because this language is tough to parse. It uses whitespace as a token separator SOMETIMES, so I had to rewrite everything to follow the language spec. Once I'm done with this rewrite that covers all the features I've had so far, it should be straightforward to implement the rest!

@Alex-Muirhead
Copy link
Author

Amazing, I'm keen to have all those features! I'm using it from helix myself, so that will work great for me too.

Argh yes, I've noticed those complications as I've scrolled through some of your notes and implementation.

@lf-
Copy link

lf- commented Apr 5, 2023

If you run into really funny whitespace behaviour similar to how Python and Haskell use indents in place of braces, you might have to make like tree-sitter-haskell and write a custom lexer, although that is ... not a task for the faint of heart, as a contributor to that one.

@SeniorMars
Copy link
Owner

It's funny you say that, I'm working on the custom scanner right now and looking at python and haskell for so much reference. This language is soo big. It's like a full markdown parser + a python parser + latex math mode. It's not really fun.

@Slickytail
Copy link

I've begun writing highlight queries (for neovim, at least). It really doesn't take very long, and I expect to have highlights written for all the currently supported syntax pretty soon.

@SeniorMars
Copy link
Owner

Highlights and other queries have been low on my priority list as I thought it would be much more important to complete markup. I was super busy last week, but I also realized how to implement the rest of the language: i.e., rewrite scanner.c.

We can leave a lot of the code for code mode intact, but for other markup and math mode the best way would be to write a custom lexer :(. I have time now, so I'll be working on typst-projects again.

@jooooscha
Copy link

Any updates on this?

Any way I can help to speed things up?

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

5 participants