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

Pull in queries from Tree-sitter grammar repositories by default #1659

Open
uncenter opened this issue Nov 12, 2024 · 2 comments
Open

Pull in queries from Tree-sitter grammar repositories by default #1659

uncenter opened this issue Nov 12, 2024 · 2 comments

Comments

@uncenter
Copy link
Contributor

I'm developing an extension for my https://github.com/uncenter/tree-sitter-tera grammar. Neovim Tree-sitter automatically pulls in the queries from https://github.com/uncenter/tree-sitter-tera/tree/main/queries, but I believe for Zed I will have to copy these over (or have some sort of build/update script) to the extension source. It would be nice if by adding the grammar Zed would look in the queries/ directory by default.

@lnay
Copy link
Contributor

lnay commented Dec 12, 2024

The capture group names typically used in the neovim highlight queries don't always match with ones in zed themes. There's also special capture groups with special behaviour in neovim such as "spell", and quite a few directives like "lua-match" (in zed use "match" instead), or "offset" that are not available in zed.

@uncenter
Copy link
Contributor Author

uncenter commented Dec 12, 2024

The capture group names typically used in the neovim highlight queries don't always match with ones in zed themes.

They should though! The Tree-sitter ecosystem is doing a good job of converging on standarized captures, though Zed is currently somewhat of an exception in that it uses non-standard language injection captures (zed-industries/zed#9654) and doesn't support extending queries either. This shouldn't be considered an argument against this, rather an issue that needs to be fixed.

There's also special capture groups with special behaviour in neovim such as "spell"

Can't these captures just be ignored?

and quite a few directives like "lua-match" (in zed use "match" instead), or "offset" that are not available in zed.

Sure, but the vast majority of queries are compatible, not to mention that grammars should be using match if possible, Zed could even support lua-match I imagine, and Zed should support offsets.

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