aMOPel / tree-sitter-nim

tree-sitter parser for the nim programming language
MIT License
36 stars 10 forks source link

WIP but functional queries #17

Closed omentic closed 1 year ago

omentic commented 1 year ago

In the future, hopefully we can use alaviss's rewrite, but for now we might as well keep the queries and the grammar together. It works pretty damn well anyway: 2023-03-03-111406

aMOPel commented 1 year ago

Good work! Nice to see that it works nicely so far. What happens when you use the problematic syntax elements? Does it just not highlight those correctly or does everything afterwards fail too?

omentic commented 1 year ago

Everything else fails, unfortunately. I've been having trouble getting typeDesc in particular to work: and so resorted to just (typeDesc) @type (that's why all of seq[int] is highlighted, and why it isn't highlighted at all in type declarations).

I need to figure out some way to dump a tree of what the grammar is seeing: I think neovim provides this? But I have to get queries working for Neovim first as Helix uses slightly different terms.

aMOPel commented 1 year ago

I need to figure out some way to dump a tree of what the grammar is seeing

I hope my answer in #16 resolves this question