DerekStride / tree-sitter-sql

SQL grammar for tree-sitter
http://derek.stride.host/tree-sitter-sql/
MIT License
147 stars 47 forks source link

Highlighting queries rely on neovim-only `lua-match` #220

Closed Colonial-Dev closed 9 months ago

Colonial-Dev commented 10 months ago

Specifically, the rules for matching literal numbers and floats.

As far as I'm aware, lua-match is exclusive to Neovim's implementation of tree-sitter based syntax highlighting. This means that highlighting numeric literals will silently fail when using something like the standard tree-sitter-highlight package.

I think changing them to use match with these regexes should work the same way. However, I've never created a tree-sitter grammar, so I figured it would be best left to your discretion.

These worked fine when tested in Rustexp.

matthias-Q commented 10 months ago

Thanks for your comment. I think this query is not used anywhere. It is just for us that we make sure to provide a query for all of the keywords of the parser.

However, the regex for numbers has been changed recently and probably needs to be updated in the respective downstream packages (e.g. nvim-treesitter, helix...)

Colonial-Dev commented 10 months ago

I think this query is not used anywhere.

I actually use it in my library Inkjet :sweat_smile: I stumbled upon this issue while writing some integration tests for it.

Since this grammar bills itself as targeted at tree-sitter rather than (say) Neovim, I think the highlighting queries should be maximally compatible if they're provided.

matthias-Q commented 9 months ago

fixed by #225

Colonial-Dev commented 9 months ago

Thanks a bunch!