Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update TSQ queries #2960

Merged
merged 1 commit into from
Jul 5, 2022
Merged

Conversation

the-mikedavis
Copy link
Member

A few changes to make TSQ highlights better:

  • A parsing error has been fixed in the grammar itself
    • Previously tree-sitter-tsq did not parse the variables
      in predicates like (#set! injection.language "javascript")
  • Theme nodes as tag
    • The newly added node to the parser (from the above fix) is
      variable which takes over the variable capture from nodes
  • Highlight known predicates as function and unsupported
    predicates as error
    • This may help when translating queries from nvim-treesitter.
      For example #any-of? is a common one used in nvim-treesitter
      queries but not implemented in Helix or tree-sitter-cli.
  • Inject tree-sitter-regex into #match? predicates

A few changes to make TSQ highlights better:

* A parsing error has been fixed in the grammar itself
    * Previously tree-sitter-tsq did not parse the variables
      in predicates like `(#set! injection.language "javascript")`
* Theme nodes as `tag`
    * The newly added node to the parser (from the above fix) is
      `variable` which takes over the `variable` capture from nodes
* Highlight known predicates as `function` and unsupported
  predicates as `error`
    * This may help when translating queries from nvim-treesitter.
      For example `#any-of?` is a common one used in nvim-treesitter
      queries but not implemented in Helix or tree-sitter-cli.
* Inject tree-sitter-regex into `#match?` predicates
@archseer archseer merged commit aacd0c8 into helix-editor:master Jul 5, 2022
@the-mikedavis the-mikedavis deleted the md-tsq-queries branch July 5, 2022 12:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants