tree-sitter-grammars / tree-sitter-query

TS query grammar for tree-sitter
Apache License 2.0
52 stars 14 forks source link

fix: properly handle supertypes #34

Closed amaanq closed 6 months ago

clason commented 6 months ago

Did you test this with the query formatter and linter?

amaanq commented 6 months ago

nope, not sure how

clason commented 6 months ago

This inflates state count quite a bit, though...

nope, not sure how

Manually build the parser, put it in .local/share/nvim/site/parser, then open the Haskell query with Neovim.

clason commented 6 months ago

Seems to work as well. I do worry about state count, though. Maybe try moving the seq into a separate hidden rule?

clason commented 6 months ago

Also, this will break queries, which expect name: (identifier)?

amaanq commented 6 months ago

Seems to work as well. I do worry about state count, though. Maybe try moving the seq into a separate hidden rule?

This increases it by 30

Also, this will break queries, which expect name: (identifier)?

No, unless it's anchored, since the name field is present in both places

lucario387 commented 6 months ago

This should not break the formatter, at least from what I can see. Running format-queries runtime/queries in the haskell PR results in 0diff with the result of latest nvim-treesitter

clason commented 6 months ago

Will make a release with this later today.

clason commented 6 months ago

@amaanq Do we want to add queries for this?