-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add support for javascriptreact language #1906
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to just change the "javascript" definition to say file-types = ["js", "jsx", "mjs"]
languages.toml
Outdated
|
||
[[grammar]] | ||
name = "jsx" | ||
source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a", subpath = "jsx" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no jsx
subpath and that rev doesn't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appologies, I am not very familiar with those libs
You should be able to just change the "javascript" definition to say
file-types = ["js", "jsx", "mjs"]
Would that be enough to fix the issue? No need to add a dedicated section? I though I may use typescriptreact because it's compatible with javascript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's a bit weird, but tree-sitter-javascript supports both js
and jsx
, but tree-sitter-typescript requires you to build two separate grammars.
It looks like we may need to add these queries for jsx to |
Yeah we actually already include them: https://github.com/helix-editor/helix/tree/master/runtime/queries/javascript There's a TODO or two about it in |
I'll do that in a follow-up |
Trying to add support for jsx (javascriptreact) syntax and language server.
Following up on this discussion: #1899