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

Update Typescript, TSX and Svelte grammar, to latest tag #6874

Merged
merged 7 commits into from Jul 14, 2023

Conversation

jeppech
Copy link
Contributor

@jeppech jeppech commented Apr 25, 2023

Support for the satisfies-keyword in Typescript
Support for the @const-expression in Svelte templates

@jeppech
Copy link
Contributor Author

jeppech commented Apr 25, 2023

I just saw that the tsx-grammar, uses the typescript tree sitter repo too. So I've updated that as well.

@jeppech jeppech changed the title Update Typescript and Svelte grammar, to latest tag Update Typescript, TSX and Svelte grammar, to latest tag Apr 25, 2023
@archseer
Copy link
Member

Did you also check for any query differences or new nodes we can now highlight? It's usually not enough to just bump the grammar

@jeppech
Copy link
Contributor Author

jeppech commented Apr 25, 2023

@archseer Oh sorry, I did not know, I'll take a closer look at the changes, to the different repos.

@jeppech
Copy link
Contributor Author

jeppech commented Apr 25, 2023

I've added the satisfies-keyword in highlights.scm for typescript, and an alternative css injection, for svelte templates, that the svelte tree-sitter repo mentioned.

I'm unsure, where I can find any new node that the repos may have added.

runtime/queries/svelte/injections.scm Outdated Show resolved Hide resolved
(attribute
(quoted_attribute_value (attribute_value))))
(raw_text) @css))

((attribute
(attribute_name) @_attr
(quoted_attribute_value (attribute_value) @css))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern actually doesn't do anything currently because it uses the neovim style of injection query. This one needs to become:

((attribute
    (attribute_name) @_attr
    (quoted_attribute_value (attribute_value) @injection.content))
 (#eq? @_attr "style")
 (#set! injection.language "css"))

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-language-support Area: Support for programming/text languages labels Jul 13, 2023
@archseer archseer merged commit bc4f08f into helix-editor:master Jul 14, 2023
6 checks passed
@jeppech jeppech deleted the update-grammar branch July 17, 2023 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants