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

Move .jsx to JavaScript and remove JSX section and babel-sublime submodule #5133

Merged
merged 7 commits into from
Jan 13, 2021

Conversation

lildude
Copy link
Member

@lildude lildude commented Jan 8, 2021

Description

Whilst looking into #4835 I remembered that GitHub no longer uses the JavaScript grammar supplied with Linguist to highlight JavaScript files and instead uses the treesitter grammar at https://github.com/tree-sitter/tree-sitter-javascript . That grammar already has support for React/JSX and from the little experiment in https://gist.github.com/lildude/a67721aeaef649bbd3f8a38101d99798 it does a good job of highlighting the React/JSX fragments and doesn't stumble over the problem #4835 details.

To be clear, sample.js is using the treesitter grammar, whilst the identical sample.jsx is using the really old https://github.com/github-linguist/babel-sublime grammar.

This PR addresses the highlighting issue by passing responsibility on to the treesitter grammar as it does a much better job of it.

We can't remove the JavaScript grammar from Linguist as it is used by other languages which aren't covered by the treesitter grammar.

Checklist:

@lildude lildude requested a review from a team as a code owner January 8, 2021 15:35
@lildude lildude merged commit 5930fae into master Jan 13, 2021
@lildude lildude deleted the lildude/move-jsx-to-js branch January 13, 2021 09:38
thorn0 added a commit to prettier/prettier that referenced this pull request Feb 22, 2021
thorn0 added a commit to prettier/prettier that referenced this pull request Feb 22, 2021
simison added a commit to Trustroots/trustroots that referenced this pull request Jun 9, 2021
Github has removed special JSX highlighting in Linguist, the library Github uses for syntax highlighting. It's now merged into JS highlighter. Hence we can let JS files be syntax highlighted as JS.

Reference github-linguist/linguist#5133
simison added a commit to Trustroots/trustroots that referenced this pull request Jun 9, 2021
Github has removed special JSX highlighting in Linguist, the library Github uses for syntax highlighting. It's now merged into JS highlighter. Hence we can let JS files be syntax highlighted as JS.

Reference github-linguist/linguist#5133
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants